mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-26 19:15:09 +00:00
[JENKINS-70531] Apply timeout on WebSocket write operations (#7596)
* Apply timeout on WebSocket write operations * https://github.com/jenkinsci/remoting/pull/621 released
This commit is contained in:
1 parent
88830540db
commit
e0aee591d0
2 files changed
+14
-5
No files matched your search
@@ -44,6 +44,7 @@ import java.security.MessageDigest;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import jenkins.slaves.JnlpAgentReceiver;
|
||||
@@ -166,11 +167,19 @@ public final class WebSocketAgents extends InvisibleAction implements Unprotecte
|
||||
|
||||
class Transport extends AbstractByteBufferCommandTransport {
|
||||
|
||||
Transport() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void write(ByteBuffer header, ByteBuffer data) throws IOException {
|
||||
LOGGER.finest(() -> "sending message of length " + ChunkHeader.length(ChunkHeader.peek(header)));
|
||||
sendBinary(header, false);
|
||||
sendBinary(data, true);
|
||||
protected void write(ByteBuffer headerAndData) throws IOException {
|
||||
// As in Engine.runWebSocket:
|
||||
LOGGER.finest(() -> "sending message of length " + (headerAndData.remaining() - ChunkHeader.SIZE));
|
||||
try {
|
||||
sendBinary(headerAndData).get(5, TimeUnit.MINUTES);
|
||||
} catch (Exception x) {
|
||||
throw new IOException(x);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,7 +87,7 @@ THE SOFTWARE.
|
||||
<changelog.url>https://www.jenkins.io/changelog</changelog.url>
|
||||
|
||||
<!-- Bundled Remoting version -->
|
||||
<remoting.version>3085.vc4c6977c075a</remoting.version>
|
||||
<remoting.version>3107.v665000b_51092</remoting.version>
|
||||
<!-- Minimum Remoting version, which is tested for API compatibility -->
|
||||
<remoting.minimum.supported.version>4.7</remoting.minimum.supported.version>
|
||||
|
||||
|
||||
Reference in new issue
Block a user