Copilot commented on code in PR #3765:
URL: https://github.com/apache/celeborn/pull/3765#discussion_r3636485571
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Controller.scala:
##########
@@ -218,6 +220,7 @@ private[deploy] class Controller(
val msg = s"Not all primary partition satisfied for $shuffleKey"
logWarning(s"[handleReserveSlots] $msg, will destroy writers.")
destroyWriters(primaryLocs, shuffleKey)
+ workerSource.incCounter(WorkerSource.RESERVE_SLOTS_FAIL_COUNT)
context.reply(ReserveSlotsResponse(StatusCode.RESERVE_SLOTS_FAILED, msg))
return
Review Comment:
`RESERVE_SLOTS_FAIL_COUNT` is incremented after `destroyWriters(...)`. If
`destroyWriters` (or underlying `PartitionDataWriter.destroy`) throws, the
metric won't be recorded and the RPC reply may never be sent. Increment the
fail counter before attempting cleanup so failures are always counted even when
cleanup fails.
This issue also appears on line 244 of the same file.
--
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]