未验证 提交 1fd0cb24 编写于 作者: J Jesse Glick 提交者: Alexander Brandes

[JENKINS-70531] Apply timeout on WebSocket write operations (#7596)

* Apply timeout on WebSocket write operations
* https://github.com/jenkinsci/remoting/pull/621 released

(cherry picked from commit e0aee591)
上级 35988a12
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册