Skip to content
Commit dcbdbcc5 authored by Kohsuke Kawaguchi's avatar Kohsuke Kawaguchi
Browse files

[CLOUDBEES-2018] fixing the root cause.

At some point after this code was originally written, I/O in remoting
became asynchronous. So we need to sync with that before we swap out
the new log output stream, or else you cut off stuff at the wrong
moment.

Normally the command transfer in remoting is slow enough that
you get more or less synchronized output anyway, which is why
this poblem remained unnoticed.

But if the uncliamed buffer gets large, write operation will take a long
time, which makes this issue more likely to show up.

This fix address this problem by doing a proper sync.
The recycling of ByteArrayOutputStream is also disabled because it makes
synchronization tricky.
parent 982946be
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment