Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ping repeatedly from ping thread #383

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
formatting
cpt1gl0 committed Nov 18, 2020
commit 063c8f6d537a82dacd7702604cb719133336af30
11 changes: 6 additions & 5 deletions src/main/java/hudson/remoting/PingThread.java
Original file line number Diff line number Diff line change
@@ -127,8 +127,8 @@ private void ping() throws IOException, InterruptedException {
Future<?> f = channel.callAsync(new Ping());

try {
LOGGER.log( Level.FINE, "waiting {0}s on {1}",
new Object[] {TimeUnit.MILLISECONDS.toSeconds(timeout), channel.getName()} );
LOGGER.log(Level.FINE, "waiting {0}s on {1}",
new Object[] {TimeUnit.MILLISECONDS.toSeconds(timeout), channel.getName()});
f.get(timeout, TimeUnit.MILLISECONDS);
LOGGER.log(Level.FINE, "ping succeeded on {0}", channel.getName());
return;
@@ -141,12 +141,13 @@ private void ping() throws IOException, InterruptedException {

} catch (TimeoutException e) {
LOGGER.log(Level.WARNING, "ping timeout {0}/{1} on {2}",
new Object[] {timeouts, maxTimeouts, channel.getName()} );
new Object[] {timeouts, maxTimeouts, channel.getName()});
}
}

onDead(new TimeoutException( String.format("Ping started at %d hasn't completed by %d",
start, System.currentTimeMillis()) ));
onDead(new TimeoutException
( String.format("Ping started at %d hasn't completed by %d",
start, System.currentTimeMillis()) ));
}

/**