This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/branch-0.5 by this push:
new 10af1720b [CELEBORN-1726][FOLLOWUP] Avoid NPE when transition worker
state
10af1720b is described below
commit 10af1720b4d0506ff2a8f979039757992565b72e
Author: Weijie Guo <[email protected]>
AuthorDate: Fri Nov 22 15:16:53 2024 +0800
[CELEBORN-1726][FOLLOWUP] Avoid NPE when transition worker state
### 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]>
(cherry picked from commit d722b7621db244280924097c39e2c9813fcbe241)
Signed-off-by: SteNicholas <[email protected]>
---
.../apache/celeborn/service/deploy/worker/WorkerStatusManager.scala | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/WorkerStatusManager.scala
b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/WorkerStatusManager.scala
index 1a68c0e69..4f5a8453e 100644
---
a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/WorkerStatusManager.scala
+++
b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/WorkerStatusManager.scala
@@ -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.")