Copilot commented on code in PR #3753:
URL: https://github.com/apache/celeborn/pull/3753#discussion_r3526556123
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -967,6 +967,22 @@ private[celeborn] class Worker(
sb.toString()
}
+ override def workerEvent(eventType: String): String = {
+ eventType.toUpperCase(Locale.ROOT) match {
+ case "DECOMMISSIONTHENIDLE" =>
+ workerStatusManager.doTransition(WorkerEventType.DecommissionThenIdle)
+ case "RECOMMISSION" =>
+ workerStatusManager.doTransition(WorkerEventType.Recommission)
+ case _ =>
+ return s"Unsupported worker event type: $eventType. Legal types are
'DECOMMISSIONTHENIDLE' and 'RECOMMISSION'."
+ }
+ val sb = new StringBuilder
+ sb.append("============================ Worker Event
=============================\n")
+ sb.append(s"Worker event $eventType triggered: \n")
+ sb.append(workerInfo.toString()).append("\n")
+ sb.toString()
Review Comment:
The success message always says the worker event was "triggered", but
`WorkerStatusManager#doTransition` can be a no-op (e.g., event received while
in an exit state or when the current state doesn't allow the requested
transition). This can mislead operators reading the returned message. Consider
wording this as "received" and/or include the resulting state after handling
the event.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]