Skip to content

Commit

Permalink
[FIXED JENKINS-38473] Set a short timeout on the socket when using it…
Browse files Browse the repository at this point in the history
… to wake the acceptor thread. (#2564)

* [FIXED JENKINS-38473] Set a short timeout on the socket when using it to wake the acceptor thread.

* [JENKINS-38473] Remove leftover typing in wrong window
  • Loading branch information
stephenc authored and oleg-nenashev committed Oct 1, 2016
1 parent d7598f1 commit 1689f6b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/hudson/TcpSlaveAgentListener.java
Expand Up @@ -170,6 +170,7 @@ public void shutdown() {
if (localAddress instanceof InetSocketAddress) {
InetSocketAddress address = (InetSocketAddress) localAddress;
Socket client = new Socket(address.getHostName(), address.getPort());
client.setSoTimeout(1000); // waking the acceptor loop should be quick
new PingAgentProtocol().connect(client);
}
} catch (IOException e) {
Expand Down

0 comments on commit 1689f6b

Please sign in to comment.