Skip to content

[BUG] Gateway instance reporting uses configured port instead of the bound server port #7732

Closed

Description

@Aias00

Current behavior

Independent HeartbeatListener starts a periodic reporter from its constructor and fills instancePort from ServerProperties.getPort(). The WebSocket sync service likewise passes serverProperties.getPort() into its client. These are configured values rather than the port actually bound by the running web server.

When server.port=0, the server obtains a real ephemeral port, but the report/client header carries 0. Admin identity includes the reported port, so instance information cannot identify the actual listener and multiple processes behind the same reported address can collide. The independent reporter also schedules immediately, before receiving a server-initialized event.

Source evidence

Acceptance criteria

  • Use the actual bound application-server port after server initialization; account for a distinct management port without reporting it as the gateway listener.
  • Do not publish a placeholder port before initialization. Define startup/stop ordering and reject invalid/unavailable port observations consistently.
  • Integration-test server.port=0 and explicit fixed ports for the independent and WebSocket paths; verify two processes receive distinct appropriate identities.
  • Audit the HTTP sync path for the same configuration-versus-bound-port assumption and explicitly cover it if affected.
  • Preserve reporting shutdown/cancellation and avoid adding a second heartbeat scheduler.

Source-based finding; no ephemeral-port deployment was run during issue preparation. Related: #7696 corrects the instance type, and #7718 defines richer instance identity/readiness; neither supplies the actual bound port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    admintype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions