Uh oh!
There was an error while loading. Please reload this page.
[SPARK-23785][LAUNCHER] LauncherBackend doesn't check state of connection before setting state - #20893
[SPARK-23785][LAUNCHER] LauncherBackend doesn't check state of connection before setting state#20893sahilTakiar wants to merge 1 commit into
Conversation
…tion before setting state
| _isConnected = false | ||
| super.close() | ||
| } finally { | ||
| onDisconnected() |
There was a problem hiding this comment.
I searched the code and seems this is a no-op?
There was a problem hiding this comment.
_isConnected is used in def isConnected(). Moving it from the finally block to before the call to super.close() avoids a race condition where a client tries to write to the connection after it has been closed.
There was a problem hiding this comment.
I know your meaning, but I'm not referring to isConnected, I mean onDisconnected seems not doing anything on Spark side.
There was a problem hiding this comment.
This is not quite directly related, but this should means it is safe to move _isConnected = false to before onDisconnected().
There was a problem hiding this comment.
Yeah, your right, it doesn't look like onDisconnected is being used anywhere, but its marked as protected so I guess its meant to be used by a sub-class (although no sub-class uses it).
So agree, this change should be safe, it doesn't change the semantics of any use of onDisconnected
jiangxb1987
commented
Mar 26, 2018
The change looks good, cc @cloud-fan |
felixcheung
commented
Mar 26, 2018
Jenkins, ok to test |
SparkQA
commented
Mar 26, 2018
Test build #88577 has finished for PR 20893 at commit
|
vanzin
commented
Mar 26, 2018
retest this please |
vanzin
commented
Mar 26, 2018
The change looks ok but the test being added is totally unrelated to it. If you want to write a test, it should be not too hard to add something to |
Ok, I'll work on writing a test for The test added here was meant to cover the race condition mentioned here |
SparkQA
commented
Mar 27, 2018
Test build #88604 has finished for PR 20893 at commit
|
sahilTakiar
commented
Mar 28, 2018
Wrote a test in Seems the failures I was seeing in HIVE-18533 are due to something else. Regardless, this is still probably a good fix since you still don't want to write to the connection unless its open, but given that the exception is only logged and not thrown, don't see an easy way to write a test for this. |
vanzin
commented
Mar 28, 2018
SGTM. Jenkins, retest this please. |
vanzin
commented
Mar 28, 2018
retest this please |
SparkQA
commented
Mar 29, 2018
Test build #88679 has finished for PR 20893 at commit
|
vanzin
commented
Mar 29, 2018
Merging to master / 2.3. |
…tion before setting state ## What changes were proposed in this pull request? Changed `LauncherBackend` `set` method so that it checks if the connection is open or not before writing to it (uses `isConnected`). ## How was this patch tested? None Author: Sahil Takiar <stakiar@cloudera.com> Closes#20893 from sahilTakiar/master. (cherry picked from commit 491ec11) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
Hi, @vanzin and @sahilTakiar . Could you take a look at branch-2.3 master
|
vanzin
commented
Mar 30, 2018
Let me revert the change from 2.3 and open a bug for the flaky test. |
dongjoon-hyun
commented
Mar 30, 2018
Thank you so much for swift action, @vanzin ! |
gatorsmile
commented
Apr 2, 2018
Could we revert the PR from the master brach too? |
gatorsmile
commented
Apr 2, 2018
gatorsmile
commented
Apr 2, 2018
Let me revert this PR from the master. Please resubmit the PR after addressing the flaky tests. Thanks! |
vanzin
commented
Apr 2, 2018
The test is fixed by #20950. Just push that one instead. |
gatorsmile
commented
Apr 2, 2018
I see. Could you merge that PR? |
vanzin
commented
Apr 2, 2018
Sure. Although I'm not sure why other committers who review PRs don't just merge them too... |
…tion before setting state ## What changes were proposed in this pull request? Changed `LauncherBackend` `set` method so that it checks if the connection is open or not before writing to it (uses `isConnected`). ## How was this patch tested? None Author: Sahil Takiar <stakiar@cloudera.com> Closesapache#20893 from sahilTakiar/master.
What changes were proposed in this pull request?
Changed
LauncherBackendsetmethod so that it checks if the connection is open or not before writing to it (usesisConnected).How was this patch tested?
None