incubator-livy
incubator-livy copied to clipboard
[LIVY-585][SERVER] Avoid duplicate stopping log when stop/interrupt a session
What changes were proposed in this pull request?
There's duplicate stopping log when stop/interrupt a session. This happens because server logs stopping info when we stopping/interrupting a session at the first time. And when the session expired, it would be removed from session manager and call stop() and logs stopping info for the second time(Though, it does not really stop the session again at this time).
The fix is quite simple by adding a _stopped
flag in Session's stop()
method.
How was this patch tested?
N.A.(?)
@vanzin please have a look, thx.
@mgaido91 Thank you for your review. I've updated it.
Codecov Report
Merging #166 into master will decrease coverage by
0.05%
. The diff coverage is44.44%
.
@@ Coverage Diff @@
## master #166 +/- ##
============================================
- Coverage 68.82% 68.77% -0.06%
+ Complexity 907 906 -1
============================================
Files 100 100
Lines 5662 5671 +9
Branches 848 852 +4
============================================
+ Hits 3897 3900 +3
- Misses 1213 1216 +3
- Partials 552 555 +3
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
.../main/scala/org/apache/livy/sessions/Session.scala | 73.72% <44.44%> (+0.27%) |
20 <1> (+1) |
:arrow_up: |
...cala/org/apache/livy/scalaapi/ScalaJobHandle.scala | 52.94% <0%> (-2.95%) |
7% <0%> (ø) |
|
...ain/java/org/apache/livy/rsc/driver/RSCDriver.java | 78.81% <0%> (-1.28%) |
42% <0%> (ø) |
|
...e/livy/server/interactive/InteractiveSession.scala | 69.11% <0%> (+0.07%) |
44% <0%> (ø) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d5b27dd...a19ea7c. Read the comment docs.
If we are calling stop when it is not necessary, I think we should rather avoid calling it in those cases.
I was thinking about that way, but I was not sure whether it's the only place where calling stop unnecssary. So, I think it may be better to cover those cases(if any) in method stop (just like the thing we do in IteractiveSession.stopSession
).
I think it may be better to cover those cases(if any) in method stop
I don't really agree with you. Let me cc @vanzin for his opinion too on this.