You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
There is a potential deadlock in DubboProtocol#getSharedClient #677
Synchronized on String#intern is a bad practice, interning a string will make it a global object .Which means if you synchronized the same interned strings in different parts of your code , some shit'll happen ,eg : deadlock
@beiwei30 how about a lock pool, so basically this pool always return the same lock instance with the same key, and use something like access time to collect unused instance
@aCoder2013 a lock pool certainly works, but it make no difference with str.intern() if recycling is not considered, furthermore, it should occupy more memory. Are we facing overhead design here? :)
@beiwei30 interning a string will make it a global object, but each service can have its own lock pool .
I didn't read all the source code here ,do we need to consider memory consumption?
Activity
chickenlj commentedon Nov 30, 2017
If we put all export/refer actions into a single serial process, we can get rid locks.
We've decided to solve this problem that way.
beiwei30 commentedon May 23, 2018
dead lock will not happen since this is the only place to use
str.intern()in dubbo code base, but to be safe, I decide to change it to:to solve the potential issue.
aCoder2013 commentedon May 23, 2018
@beiwei30 how about a lock pool, so basically this pool always return the same lock instance with the same key, and use something like access time to collect unused instance
beiwei30 commentedon May 23, 2018
@aCoder2013 a lock pool certainly works, but it make no difference with str.intern() if recycling is not considered, furthermore, it should occupy more memory. Are we facing overhead design here? :)
aCoder2013 commentedon May 23, 2018
@beiwei30 interning a string will make it a global object, but each service can have its own lock pool .
I didn't read all the source code here ,do we need to consider memory consumption?
beiwei30 commentedon May 24, 2018
@aCoder2013 how about this:
aCoder2013 commentedon May 24, 2018
LGTM!
beiwei30 commentedon May 24, 2018
:)
Merge pull request apache#1836, there is a potential deadlock in Dubb…
fix default setting (#4955)