Skip to content


Partial fix for HUDSON-7745 #2

wants to merge 1 commit into from

2 participants


There was an issue in 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.

@mlb5000 mlb5000 [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.

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 :)


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 has been hanging for like 4 days.


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
Commits on Jan 29, 2011
  1. @mlb5000

    [HUDSON-7745] Fix for two of the errors described in this bug report.…

    mlb5000 committed
    … This is just a band-aid and ultimately someone should take a look at rewriting this.
6 remoting/src/main/java/hudson/remoting/
@@ -99,8 +99,6 @@ public int hashCode() {
static class Real extends PipeWindow {
private int available;
- private long written;
- private long acked;
private final int oid;
* The only strong reference to the key, which in turn
@@ -118,7 +116,6 @@ public synchronized void increase(int delta) {
if (LOGGER.isLoggable(FINER))
available += delta;
- acked += delta;
@@ -139,7 +136,7 @@ public int get() throws InterruptedException {
if (available>0)
return available;
- while (available==0) {
+ while (available<=0) {
@@ -155,7 +152,6 @@ public synchronized void decrease(int delta) {
if (LOGGER.isLoggable(FINER))
available -= delta;
- written+= delta;
HUDSON-7745 says the following assertion fails, which AFAICT is only possible if multiple
threads write to OutputStream concurrently, but that doesn't happen in most of the situations, so
7 remoting/src/main/java/hudson/remoting/
@@ -81,7 +81,7 @@ synchronized void connect(Channel channel, int oid) throws IOException { = channel;
this.oid = oid;
- window = channel.getPipeWindow(oid);
+ window = channel.getPipeWindow(oid);
// if we already have bytes to write, do so now.
if(tmp!=null) {
@@ -115,6 +115,11 @@ private void _write(byte[] b, int off, int len) throws IOException {
while (len>0) {
int sendable;
try {
+ // @TODO This is just a hack for now. Figure out why the window is unexpectedly destroyed.
+ if (window == null)
+ {
+ window = channel.getPipeWindow(oid);
+ }
sendable = Math.min(window.get(),len);
} catch (InterruptedException e) {
throw (IOException)new InterruptedIOException().initCause(e);
Something went wrong with that request. Please try again.