Skip to content

[JENKINS-16057] Problems with dual-stack IPv4 / IPv6 machines #81

@jenkins-infra-bot

Description

@jenkins-infra-bot

The plugin was checking whether a named port was free on the build machine, but even when the port was already in use by some daemon, the plugin wrongly reported that the port was available.

The reason appeared to be that our daemon was listening on an IPv4 socket, but the ServerSocket created on the same port by Jenkins defaulted to IPv6, which apparently succeeded.

Switching Jenkins to IPv4 (via java.net.preferIPv4Stack=true) solved the problem.

But it would be nice if Jenkins could handle this situation automatically.

Maybe something like this? I need to investigate when I get time:

server = new ServerSocket();
server.bind(new InetSocketAddress(InetAddress.getByName("::"), port));


Originally reported by orrc, imported from: Problems with dual-stack IPv4 / IPv6 machines
  • status: Open
  • priority: Minor
  • component(s): port-allocator-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251216-225446
Raw content of original issue

The plugin was checking whether a named port was free on the build machine, but even when the port was already in use by some daemon, the plugin wrongly reported that the port was available.

The reason appeared to be that our daemon was listening on an IPv4 socket, but the ServerSocket created on the same port by Jenkins defaulted to IPv6, which apparently succeeded.

Switching Jenkins to IPv4 (via java.net.preferIPv4Stack=true) solved the problem.

But it would be nice if Jenkins could handle this situation automatically.

Maybe something like this? I need to investigate when I get time:

server = new ServerSocket();
server.bind(new InetSocketAddress(InetAddress.getByName("::"), port));
  • environment: Mac OS X 10.8.2 master, no slaves

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions