Skip to content

Avoid fixed ports in ActorsLeakSpec - #3736

Merged
pjfanning merged 1 commit into
apache:mainfrom
He-Pin:fix/actors-leak-spec-ports
Oct 30, 2026
Merged

pjfanning merged 1 commit into
apache:mainfrom
He-Pin:fix/actors-leak-spec-ports

Conversation

@He-Pin

@He-Pin He-Pin commented Oct 30, 2026

Copy link
Copy Markdown
Member

Motivation

ActorsLeakSpec can fail with java.net.BindException: Address already in use when its default port 7355 or hardcoded restart port 7356 is occupied. This failed the Scala 3 validation of #3730.

Modification

  • Let the first incarnation bind an available port and reuse its actual address after termination.
  • Assert that restarted systems retain the address and receive a different UID, preserving the quarantine scenario.
  • Add a regression that starts independent systems and checks that their allocated ports differ; wait for termination in the restart cleanup path.

Result

The spec passes while both former fixed ports are occupied, preserving its actor cleanup and same-address restart coverage.

Tests

  • Original implementation: holding 127.0.0.1:7356 reproduces the CI BindException.
  • Updated implementation: remote / Test / testOnly org.apache.pekko.remote.classic.ActorsLeakSpec passes both tests on JDK 17 with Scala 2.13.18 and 3.3.9 while 127.0.0.1:7355 and :7356 are held.
  • headerCreateAll, checkCodeStyle (including Java formatting and +headerCheckAll), native scalafmt, and git diff --check pass.
  • Scala next and validatePullRequest are delegated to GitHub CI.
  • Qoder stdout review is in progress.

References

Refs #3730 — failed Scala 3 CI job.

Motivation:
ActorsLeakSpec failed in PR apache#3730 CI with Address already in use because
its systems bind the default port 7355 and a hardcoded restart port 7356.

Modification:
Allocate an available port for the first incarnation, reuse its bound
address after termination, and assert that restarts retain the address
with a new UID. Verify that independent systems receive different ports.

Result:
The leak test runs while the former fixed ports are occupied and retains
its same-address quarantine and actor cleanup assertions.

Tests:
- Original implementation fails with BindException while port 7356 is held.
- Scala 2.13.18 and 3.3.9 on JDK 17: both ActorsLeakSpec tests pass while
  ports 7355 and 7356 are held.
- headerCreateAll, checkCodeStyle and git diff --check pass.
- Scala next and validatePullRequest are delegated to GitHub CI.

References:
Refs apache#3730 - CI failure in ActorsLeakSpec.
@He-Pin
He-Pin marked this pull request as ready for review October 30, 2026 03:17
@He-Pin
He-Pin requested a balanced review from Copilot October 30, 2026 03:19
@He-Pin He-Pin added this to the 2.0.0-M5 milestone Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues are reported for the change.

No open issues 🎉

Review effort: Lite

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pjfanning
pjfanning merged commit d411280 into apache:main Oct 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants