Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Partial fix for HUDSON-7745 #2

Closed
wants to merge 1 commit into from

2 participants

Matthew Baker Christopher Orr
Matthew Baker

There was an issue in PipeWindow.java where the available size could drop below 0 and the check was for exactly zero. Changing this to less than or equal to fixed that issue.

In addition to that, there is apparently a call to ProxyOutputStream.connect and subsequently channel.getpipewindow which causes ProxyOutputStream.window to get set to null. A quick check for window == null prior to using it appears to resolve that issue.

Matthew Baker [HUDSON-7745] Fix for two of the errors described in this bug report.…
… This is just a band-aid and ultimately someone should take a look at rewriting this.
e8e060d
Christopher Orr

Re: Your JIRA comment: this kohsuke/hudson repo is a month behind the "official" repo at hudson/hudson.

And thanks for hopefully solving some of these copy issues :)

Matthew Baker

crap, I wasn't sure which one was the mainline; I'll fork hudson/hudson for the future. Hopefully this helps. The major failure, which I witnessed while I was running the tests locally, was the "Not in GZIP format" error.

Also, the current Hudson build on ci.hudson-ci.org has been hanging for like 4 days.

Matthew Baker

I'm going to close this and submit the same request on hudson/hudson.

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

Showing 1 unique commit by 1 author.

Jan 28, 2011
Matthew Baker [HUDSON-7745] Fix for two of the errors described in this bug report.…
… This is just a band-aid and ultimately someone should take a look at rewriting this.
e8e060d
This page is out of date. Refresh to see the latest.
6  remoting/src/main/java/hudson/remoting/PipeWindow.java
@@ -99,8 +99,6 @@ public int hashCode() {
99 99
 
100 100
     static class Real extends PipeWindow {
101 101
         private int available;
102  
-        private long written;
103  
-        private long acked;
104 102
         private final int oid;
105 103
         /**
106 104
          * The only strong reference to the key, which in turn
@@ -118,7 +116,6 @@ public synchronized void increase(int delta) {
118 116
             if (LOGGER.isLoggable(FINER))
119 117
                 LOGGER.finer(String.format("increase(%d,%d)->%d",oid,delta,delta+available));
120 118
             available += delta;
121  
-            acked += delta;
122 119
             notifyAll();
123 120
         }
124 121
 
@@ -139,7 +136,7 @@ public int get() throws InterruptedException {
139 136
                 if (available>0)
140 137
                     return available;
141 138
 
142  
-                while (available==0) {
  139
+                while (available<=0) {
143 140
                     wait();
144 141
                 }
145 142
             }
@@ -155,7 +152,6 @@ public synchronized void decrease(int delta) {
155 152
             if (LOGGER.isLoggable(FINER))
156 153
                 LOGGER.finer(String.format("decrease(%d,%d)->%d",oid,delta,available-delta));
157 154
             available -= delta;
158  
-            written+= delta;
159 155
             /*
160 156
             HUDSON-7745 says the following assertion fails, which AFAICT is only possible if multiple
161 157
             threads write to OutputStream concurrently, but that doesn't happen in most of the situations, so
7  remoting/src/main/java/hudson/remoting/ProxyOutputStream.java
@@ -81,7 +81,7 @@ synchronized void connect(Channel channel, int oid) throws IOException {
81 81
         this.channel = channel;
82 82
         this.oid = oid;
83 83
 
84  
-        window =  channel.getPipeWindow(oid);
  84
+        window = channel.getPipeWindow(oid);
85 85
 
86 86
         // if we already have bytes to write, do so now.
87 87
         if(tmp!=null) {
@@ -115,6 +115,11 @@ private void _write(byte[] b, int off, int len) throws IOException {
115 115
             while (len>0) {
116 116
                 int sendable;
117 117
                 try {
  118
+                    // @TODO This is just a hack for now. Figure out why the window is unexpectedly destroyed.
  119
+                    if (window == null)
  120
+                    {
  121
+                        window = channel.getPipeWindow(oid);
  122
+                    }
118 123
                     sendable = Math.min(window.get(),len);
119 124
                 } catch (InterruptedException e) {
120 125
                     throw (IOException)new InterruptedIOException().initCause(e);
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.