-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-6133] Make sc.stop() idempotent #4871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #28228 has started for PR 4871 at commit
|
|
Just looking at the function it seems like this is the right thing to do. Is it right-er to move these two lines after |
|
Test build #28228 has finished for PR 4871 at commit
|
|
Test PASSed. |
This line should have prevented 2 threads from going into the inner @srowen if this is read by non-syncronised methods, only one of them will be able to go inside this method and all the others will wait, correct? Thus it could be the problem with the others methods, that run some non-synchronised logic before calling into this syncronised method. @andrewor14 Having a test would help. |
|
@o-mdr I'm referring to read of the |
I think the original issue here was that two sequential calls to This can happen when @srowen I'm not quite sure why |
|
@o-mdr This is not a race condition, so there are no concurrency issues here. The real issue is that Spark calls Also, note that any test we add here is not particularly meaningful because it would have passed even before this patch. For this reason I decided not to add one. |
|
Test build #28244 has started for PR 4871 at commit
|
|
Ah, @srowen @o-mdr I misunderstood what you guys were saying. I think what @o-mdr meant was that moving the two lines after |
|
It makes some tiny difference; my observation was that the |
|
I see, since we don't synchronize around the uses of |
|
Test build #28244 has finished for PR 4871 at commit
|
|
Test PASSed. |
Before we would get the following (benign) error if we called `sc.stop()` twice. This is because the listener bus would try to post the end event again even after it has already stopped. This happens occasionally when flaky tests fail, usually as a result of other sources of error. Either way we shouldn't be logging this error when it is not the cause of the failure. ``` ERROR LiveListenerBus: SparkListenerBus has already stopped! Dropping event SparkListenerApplicationEnd(1425348445682) ``` Author: Andrew Or <[email protected]> Closes #4871 from andrewor14/sc-stop and squashes the following commits: a14afc5 [Andrew Or] Move code after code 915db16 [Andrew Or] Move code into code (cherry picked from commit 6c20f35) Signed-off-by: Andrew Or <[email protected]>
|
Ok thanks everyone for your comments. I'm merging this into master and 1.2. I will back port this into 1.3 later after the release. |
Before we would get the following (benign) error if we called `sc.stop()` twice. This is because the listener bus would try to post the end event again even after it has already stopped. This happens occasionally when flaky tests fail, usually as a result of other sources of error. Either way we shouldn't be logging this error when it is not the cause of the failure. ``` ERROR LiveListenerBus: SparkListenerBus has already stopped! Dropping event SparkListenerApplicationEnd(1425348445682) ``` Author: Andrew Or <[email protected]> Closes #4871 from andrewor14/sc-stop and squashes the following commits: a14afc5 [Andrew Or] Move code after code 915db16 [Andrew Or] Move code into code
Before we would get the following (benign) error if we called
sc.stop()twice. This is because the listener bus would try to post the end event again even after it has already stopped. This happens occasionally when flaky tests fail, usually as a result of other sources of error. Either way we shouldn't be logging this error when it is not the cause of the failure.