Skip to content

Commit

Permalink
[CELEBORN-1726][FOLLOWUP] Avoid NPE when transition worker state
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Avoid NPE when transition worker state

### Why are the changes needed?

Fix test.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?
No need.

Closes #2938 from reswqa/fix-npe.

Authored-by: Weijie Guo <[email protected]>
Signed-off-by: SteNicholas <[email protected]>
  • Loading branch information
reswqa authored and SteNicholas committed Nov 22, 2024
1 parent a2d3972 commit d722b76
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ private[celeborn] class WorkerStatusManager(conf: CelebornConf) extends Logging
if (allowStates != null && allowStates.contains(state)) {
logInfo(s"Worker transition status from ${currentWorkerStatus.getState} to $state.")
currentWorkerStatus = new WorkerStatus(state.getNumber, System.currentTimeMillis())
worker.workerInfo.setWorkerStatus(currentWorkerStatus)
if (worker != null && worker.workerInfo != null) {
worker.workerInfo.setWorkerStatus(currentWorkerStatus)
}
} else {
logWarning(
s"Worker transition status from ${currentWorkerStatus.getState} to $state is not allowed.")
Expand Down

0 comments on commit d722b76

Please sign in to comment.