ZOOKEEPER-3706: ZooKeeper.close() would leak SendThread when the netw…#1235
ZOOKEEPER-3706: ZooKeeper.close() would leak SendThread when the netw…#1235yfxhust wants to merge 1 commit intoapache:masterfrom
Conversation
|
@yfxhust |
We observed occasional SendThread leak case in our production. But the root cause is not 100 percent sure. But from source code and some network clues, we believe that this issue is a potential cause. |
30c07d2 to
ce347e0
Compare
|
nice work - left two comments. since the request timeout is a feature disabled by default, the impact of this bug is limited to those who enabled this feature only. |
Thanks for your comments |
ce347e0 to
bf86062
Compare
|
left two more comments - current approach should work but I am wondering if my proposal would sound better in term of more structurally solve the race condition around the state variable; also was a little bit concerning around RuntimeException we throw and the implications it brought (w.r.t resource leaks) |
bf86062 to
74975f3
Compare
Thank you for your comments. I adapt my code with your suggestions. Please review the latest patch. |
f787f2b to
95accad
Compare
d1e235b to
16500a6
Compare
|
I just have two nits - one on the sync approach and the other on unit test. |
16500a6 to
52b2ef7
Compare
Thank you for your comments. Adapt my code with your suggestion. Please see the latest patch. |
52b2ef7 to
8938807
Compare
|
@hanm Any further comments ? |
hanm
left a comment
There was a problem hiding this comment.
LGTM.
Any feedback from other committers? If not, I'll land this in next few days.
eolivelli
left a comment
There was a problem hiding this comment.
Awesome work.
I left a few comments
|
@eolivelli Thank you for your comments. I adapt the patch with your suggestions. Please review the latest patch. |
…ork is broken - add unit test to verify the bug - wrap state modification in SendThread.changeZkState() - SendThread.startConnect() could be interrupted by IOException caused by SendThread.changeZkState() Author: Fangxi Yin <yinfangxi@kuaishou.com>
|
merged to master - thanks for driving this @yfxhust |
…ork is broken - add unit test to verify the bug - bypass the SendThread.startConnect() by throw RuntimeExcepth if state.isAlive is false Author: Fangxi Yin <yinfangxikuaishou.com> Author: yinfangxi <yinfangxi@kuaishou.com> Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, maoling Closes apache#1235 from yfxhust/ZOOKEEPER-3706
…ork is broken - add unit test to verify the bug - bypass the SendThread.startConnect() by throw RuntimeExcepth if state.isAlive is false Author: Fangxi Yin <yinfangxikuaishou.com> Author: yinfangxi <yinfangxi@kuaishou.com> Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, maoling Closes #1235 from yfxhust/ZOOKEEPER-3706
…ork is broken - add unit test to verify the bug - bypass the SendThread.startConnect() by throw RuntimeExcepth if state.isAlive is false Author: Fangxi Yin <yinfangxikuaishou.com> Author: yinfangxi <yinfangxi@kuaishou.com> Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, maoling Closes apache#1235 from yfxhust/ZOOKEEPER-3706
…ork is broken - add unit test to verify the bug - bypass the SendThread.startConnect() by throw RuntimeExcepth if state.isAlive is false Author: Fangxi Yin <yinfangxikuaishou.com> Author: yinfangxi <yinfangxi@kuaishou.com> Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, maoling Closes apache#1235 from yfxhust/ZOOKEEPER-3706
…ork is broken - add unit test to verify the bug - bypass the SendThread.startConnect() by throw RuntimeExcepth if state.isAlive is false Author: Fangxi Yin <yinfangxikuaishou.com> Author: yinfangxi <yinfangxi@kuaishou.com> Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, maoling Closes apache#1235 from yfxhust/ZOOKEEPER-3706
…ork is broken - add unit test to verify the bug - bypass the SendThread.startConnect() by throw RuntimeExcepth if state.isAlive is false Author: Fangxi Yin <yinfangxikuaishou.com> Author: yinfangxi <yinfangxi@kuaishou.com> Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, maoling Closes apache#1235 from yfxhust/ZOOKEEPER-3706
…ork is broken
Author: Fangxi Yin yinfangxi@kuaishou.com