He-Pin opened a new pull request, #3707:
URL: https://github.com/apache/pekko/pull/3707

   ### Motivation
   `Controller` answers `GetSockAddr` by calling the Netty bind future's 
blocking `sync()` inside its message handler. Since the same actor also hosts 
the `BarrierCoordinator`, a slow bind stalls every barrier in the suite, and a 
bind failure (e.g. the fixed conductor port 4711 being taken) is rethrown out 
of `receive` instead of being reported to the requester — the other nodes then 
time out on queries or barriers far from the cause.
   
   ### Modification
   - Register a listener on `connection.channelFuture` that reports 
`SockAddrBound(addr)` / `SockAddrBindFailed(cause)` to the Controller as 
messages.
   - `GetSockAddr` replies from the resolved address, or queues the requester 
until the bind completes.
   - A failed bind is logged, reported to pending requesters as 
`Status.Failure` (so `Conductor.sockAddr`'s Future fails and `startController` 
fails immediately and legibly), and stops the Controller.
   - `ControllerSpec`: new cases for the actually bound address (port 0) and 
for an unbindable port.
   
   Scoped to the blocking-`sync()` part of #3693; the fixed default port / 
port-0 publication across JVMs is a runner-coordination change left for 
separate discussion.
   
   ### Result
   The Controller thread never blocks on the bind future, and a conductor bind 
failure surfaces as a failed Future at the caller instead of an exception 
thrown out of a message handler.
   
   ### Tests
   - `sbt "remote-tests / Test / testOnly 
org.apache.pekko.remote.testconductor.ControllerSpec"`: 3/3 passed
   - Directional check: reverted the fix, re-ran the bind-failure test — failed 
as expected (requester never got a reply)
   - Full validation on CI (incl. multi-jvm suites which exercise 
`startController`)
   
   ### References
   Refs #3693


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to