incubator-livy
incubator-livy copied to clipboard
[LIVY-865][SERVER] Fix bug that Livy identifies valid yarn state of batch session as FAILED
What changes were proposed in this pull request?
yarnClient.getApplicationReport(appId) would return 2 states below:
- YarnApplicationState (short as yarnState)
- FinalApplicationStatus (short as finalState)
These 2 states may switch sequentially in practice, means (yarnState, finalState) as
(RUNNING, SUCCEEDED) would switch to (FINISHED, SUCCEEDED) finally.
For now, (yarnState, finalState) as (RUNNING, SUCCEEDED) would be identified as FAILED
state combination
This PR introduce new logic to map yarn state combination as bellow:
- yarnState as NEW、NEW_SAVING、SUBMITTED、ACCEPTED would be identified as
STARTING
- yarnState as RUNNING would be identified as
RUNNING
- other yarnState and finalState combinations would be identified to rules:
- (FAILED, FAILED) ->
FAILED
- (KILLED, KILLED) ->
KILLED
- (FINISHED, SUCCEEDED) ->
FINISHED
- any other combination ->
FAILED
How was this patch tested?
added UT.
@jerryshao @mgaido91 would you please help to review, thanks!
I am not familiar with this part, sorry
I am not familiar with this part, sorry
@mgaido91 thx for the reply, can you introduce any reviewer familiar with?