Repository navigation
fix: answer conductor socket address queries asynchronously (#3693) - #3707
Merged
Merged
Conversation
He-Pin
force-pushed
the
fix-3693-controller-async-sockaddr
branch
from
October 25, 2026 10:44
5554332 to
f276ada
Compare
pjfanning
reviewed
Oct 25, 2026
Motivation: The test conductor answered address queries by blocking on Netty's bind future. A bind failure escaped the message handler instead of failing the caller's Future. Modification: - Reply to each address query from a bind-future listener, capturing the requester before entering the callback. Branch directly on the completed future instead of throwing its cause through Try. - Report the bind cause through Status.Failure, including requests made after binding has already failed. - Cover ephemeral-port resolution and repeated queries after an occupied-port failure, and document the asynchronous behavior. The occupied-port test holds a listener with address reuse disabled on the exact loopback address used by the conductor. Result: Address queries do not block the Controller or depend on the ordering of the query and bind completion. Failed binds consistently report their cause. Tests: - JDK 17: sbt "remote-tests / Test / testOnly org.apache.pekko.remote.testconductor.ControllerSpec" — 3 passed again after the review follow-up. - Directional regression on the previous PR implementation: the repeated failed-bind query timed out; 2 passed, 1 failed. - Native scalafmt, sbt headerCreateAll and git diff --check — passed. - sbt sortImports — environment failure in multi-node-testkit / scalafixAll and stream-tests / scalafixAll: NoSuchMethodError for scala.meta.package$.Input(). Unrelated import changes were discarded. - Initial-revision integration validation, before this review follow-up, on JDK 17: `sbt headerCreateAll +mimaReportBinaryIssues +headerCheckAll checkCodeStyle docs/paradox` — passed. Cross-version checks passed on Scala 2.13.18 and 3.3.8. - Initial-revision integration, before this review follow-up: `sbt -Dpekko.test.tags.exclude=performance,timing,long-running -Dpekko.test.multi-in-test=false validatePullRequest` — completed, but did not pass on macOS/arm64. LevelDB JNI lacks a compatible arm64 library (four persistence test forks failed); NettyTransportSpec could not bind the unavailable local address 127.0.1.1; two existing TCP readiness tests timed out. Docker-backed DNS tests were skipped because Docker was unavailable. - The two TCP failures passed when rerun in isolation against that revision's compiled integration code, without changing assertions or timeouts. The main-production baseline also exhibited a neighboring readiness timeout; those two exact cases did not fail in the repeated baseline runs. The full-run failures are retained in the validation record. - Follow-up validation: cross Scala multi-node-testkit MiMa and multi-node-testkit/remote-tests headers — passed on Scala 2.13.18 and 3.3.8. Scoped multi-node-testkit sortImports reproduced the existing Scalafix linkage error; native scalafmt and diff checks passed. - Follow-up integration with the other reviewed changes: ControllerSpec 3/3 and `sbt docs/paradox` passed. No new `validatePullRequest` run was performed, as requested. References: Refs #3693. The runner's fixed default conductor port remains outside this change.
He-Pin
force-pushed
the
fix-3693-controller-async-sockaddr
branch
from
October 26, 2026 03:58
f276ada to
3419e19
Compare
pjfanning
approved these changes
Oct 26, 2026
pjfanning
left a comment
Member
There was a problem hiding this comment.
LGTM. I think this is safe for 2.0.0.
Blast radius is small:
- The change is confined to
multi-node-testkit, which only runs inside multi-JVM test suites. No production code path is affected. - Within that module, only the
Controller'sGetSockAddrhandler changes.Controllerisprivate[pekko]and there are no API or binary changes. - The success path returns the same bound address as before; the reply is just sent from the bind-future listener instead of blocking the actor. The callers (
startController/sockAddr) useask, so the async reply has no ordering implications. - The failure path improves: a failed bind used to crash/restart the Controller and leave the caller with an ask timeout; now the caller gets the actual
BindExceptionpromptly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The test conductor answered address queries by blocking on Netty's bind future. A bind failure escaped the message handler instead of failing the caller's Future.
Modification
Result
Address queries do not block the Controller or depend on the ordering of the query and bind completion. Failed binds consistently report their cause.
Tests
JDK 17: sbt "remote-tests / Test / testOnly org.apache.pekko.remote.testconductor.ControllerSpec" — 3 passed again after the review follow-up.
Directional regression on the previous PR implementation: the repeated failed-bind query timed out; 2 passed, 1 failed.
Native scalafmt, sbt headerCreateAll and git diff --check — passed.
sbt sortImports — environment failure in multi-node-testkit / scalafixAll and stream-tests / scalafixAll: NoSuchMethodError for scala.meta.package$.Input(). Unrelated import changes were discarded.
Initial-revision integration validation, before this review follow-up, on JDK 17:
sbt headerCreateAll +mimaReportBinaryIssues +headerCheckAll checkCodeStyle docs/paradox— passed. Cross-version checks passed on Scala 2.13.18 and 3.3.8.Initial-revision integration, before this review follow-up:
sbt -Dpekko.test.tags.exclude=performance,timing,long-running -Dpekko.test.multi-in-test=false validatePullRequest— completed, but did not pass on macOS/arm64. LevelDB JNI lacks a compatible arm64 library (four persistence test forks failed); NettyTransportSpec could not bind the unavailable local address 127.0.1.1; two existing TCP readiness tests timed out. Docker-backed DNS tests were skipped because Docker was unavailable.The two TCP failures passed when rerun in isolation against that revision's compiled integration code, without changing assertions or timeouts. The main-production baseline also exhibited a neighboring readiness timeout; those two exact cases did not fail in the repeated baseline runs. The full-run failures are retained in the validation record.
Follow-up validation: cross Scala multi-node-testkit MiMa and multi-node-testkit/remote-tests headers — passed on Scala 2.13.18 and 3.3.8. Scoped multi-node-testkit sortImports reproduced the existing Scalafix linkage error; native scalafmt and diff checks passed.
Follow-up integration with the other reviewed changes: ControllerSpec 3/3 and
sbt docs/paradoxpassed. No newvalidatePullRequestrun was performed, as requested.References
Refs #3693. The runner's fixed default conductor port remains outside this change.