Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Partial fix for HUDSON-7745 #2

Closed
wants to merge 1 commit into from

2 participants

@mlb5000

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.

@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.
e8e060d
@orrc

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

@mlb5000

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.

@mlb5000

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 authored
    … This is just a band-aid and ultimately someone should take a look at rewriting this.
This page is out of date. Refresh to see the latest.
View
6 remoting/src/main/java/hudson/remoting/PipeWindow.java
@@ -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))
LOGGER.finer(String.format("increase(%d,%d)->%d",oid,delta,delta+available));
available += delta;
- acked += delta;
notifyAll();
}
@@ -139,7 +136,7 @@ public int get() throws InterruptedException {
if (available>0)
return available;
- while (available==0) {
+ while (available<=0) {
wait();
}
}
@@ -155,7 +152,6 @@ public synchronized void decrease(int delta) {
if (LOGGER.isLoggable(FINER))
LOGGER.finer(String.format("decrease(%d,%d)->%d",oid,delta,available-delta));
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
View
7 remoting/src/main/java/hudson/remoting/ProxyOutputStream.java
@@ -81,7 +81,7 @@ synchronized void connect(Channel channel, int oid) throws IOException {
this.channel = 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.