SbloodyS commented on PR #18416:
URL: 
https://github.com/apache/dolphinscheduler/pull/18416#issuecomment-4998227869

   Thanks for addressing the previous feedback. A zero-row heartbeat update now 
disconnects the server immediately, and the added test covers the `STARTED` 
path.
   
   However, there is still a shutdown race:
   
   1. `refreshClientsHeartbeat()` passes the initial state check while the 
server is `STARTED`.
   2. `close()` concurrently changes the state to `STOPPED` and deletes the 
heartbeat rows.
   3. The in-flight `updateById()` returns `false`.
   4. This branch unconditionally overwrites `STOPPED` with `DISCONNECTED` and 
invokes `onDisConnected()` during a normal shutdown.
   
   Previously, the exception handler inspected the current state, so `STOPPED` 
was left unchanged. Please make the transition to `DISCONNECTED` 
conditional/atomic so that `close()` cannot race with the heartbeat task and 
have its terminal state overwritten. A regression test coordinating an 
in-flight heartbeat update with `close()` would also be useful.


-- 
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]

Reply via email to