Skip to content

Commit

Permalink
[FIXED JENKINS-12037] CLI - I/O error in channel Chunked connection
Browse files Browse the repository at this point in the history
Use a ping timeout of 3/4 of the ping interval instead of the default
4 minute timeout.
This happens to workaround an issue in the remoting PingThread
implementation which causes the ping to busy wait for the timeout
period instead of keeping the channel alive.
  • Loading branch information
oldelvet committed Mar 29, 2012
1 parent 860cc9e commit ea1b80a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
CLI - I/O error in channel Chunked connection/Unexpected termination of the channel - still occuring in Jenkins 1.449.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12037">issue 12037</a>)
<li class=bug>
Quiet period is blocking other jobs in queue.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12994">issue 12994</a>)
Expand Down
4 changes: 3 additions & 1 deletion cli/src/main/java/hudson/cli/CLI.java
Expand Up @@ -150,7 +150,9 @@ private Channel connectViaHttp(String url) throws IOException {
FullDuplexHttpStream con = new FullDuplexHttpStream(jenkins,authorization);
Channel ch = new Channel("Chunked connection to "+jenkins,
pool,con.getInputStream(),con.getOutputStream());
new PingThread(ch,15*1000) {
final long interval = 15*1000;
final long timeout = (interval * 3) / 4;
new PingThread(ch,timeout,interval) {
protected void onDead() {
// noop. the point of ping is to keep the connection alive
// as most HTTP servers have a rather short read time out
Expand Down

0 comments on commit ea1b80a

Please sign in to comment.