Skip to content
Permalink
Browse files
[FIXED JENKINS-8703] we still need to wait for the pipe to connect
before letting the writer loose.
  • Loading branch information
kohsuke committed Jul 1, 2011
1 parent 67ce74f commit 0f1ab580ca0846969998e93a6c1f2907103e4a6f
@@ -169,7 +169,7 @@ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound
// we want 'oidRos' to send data to this PipedOutputStream
FastPipedOutputStream pos = new FastPipedOutputStream();
FastPipedInputStream pis = new FastPipedInputStream(pos);
final int oidPos = channel.export(pos);
final int oidPos = channel.export(pos,false); // this gets unexported when the remote ProxyOutputStream closes.

// tell 'ros' to connect to our 'pos'.
channel.send(new ConnectCommand(oidRos, oidPos));
@@ -126,7 +126,13 @@ public int hashCode() {

static class Real extends PipeWindow {
private int available;
/**
* Total bytes that left our side of the channel.
*/
private long written;
/**
* Total bytes that the remote side acked.
*/
private long acked;
private final int oid;
/**
@@ -32,8 +32,10 @@ public Object call() throws Exception {
foo();
return null;
} catch (Exception e) {
e.printStackTrace();
throw e;
} catch (Throwable t) {
t.printStackTrace();
throw new Exception(t);
} finally {
Thread.currentThread().setName("done");
@@ -36,6 +36,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Arrays;
import java.util.concurrent.ExecutionException;

@@ -175,6 +176,8 @@ public void run() {

// make sure the pipe is connected
target.ensureConnected();
channel.syncLocalIO();
// then let the writer commence
writer.start();

// make sure that some data arrived to the receiver

0 comments on commit 0f1ab58

Please sign in to comment.