Streaming reconnect runs under the previous leg's expired deadline (1 ms connect budget)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- backend, networking
调研方向
Start by reading HttpTransport.java around connect(), ensureConnected() and post(), then trace the reconnect path from WsmanClient.java. Add the regression scenario described in StreamingApiTest: a late Receive response followed by a dropped connection and reconnect. Done means the streaming operation completes without a spurious connect timeout, while poll-mode deadlines remain shared across a poll.
由索引模型根据 Issue 内容生成。
描述
Problem
In streaming mode (failOnQuietTimeout, i.e. HttpTransport.inactivityTimeout()), the socket deadline is per request leg: post() re-arms deadlineEpochMillis at the start of every leg (HttpTransport.java#L350).
But a reconnect does not go through post(). When the connection is gone, WsmanClient.send() calls transport.connect() explicitly before the authentication exchange (WsmanClient.java#L1166), and ensureConnected() caps the TCP connect and the TLS handshake with boundedByDeadline(connectTimeoutMillis) (HttpTransport.java#L318). That cap uses the deadline left over from the previous leg. If that leg ran long (a Receive that waited most of the inactivity timeout before the server dropped the connection, or a round trip that timed out), the leftover deadline is nearly or fully expired, and boundedByDeadline() floors it to 1 ms. The reconnect then fails with a connect timeout that has nothing to do with the server: a spurious TimeoutException for the streaming caller, or a wasted retry when connectRetries is set.
Where it bites today
PR #197 hit it on its Delete-then-Create sequence (a retired shell's Delete timing out, then the Create's reconnect) and works around it by calling configureTimeouts() again between the two requests. That resets the deadline for that one spot only; every other reconnect inside a streaming operation (a Receive, a Send, a Signal following a dropped connection) still runs under the stale deadline.
Proposed fix
Arm the per-leg deadline in connect() the same way post() does, so a reconnect gets the whole inactivity timeout for itself:
void connect() throws IOException {
if (deadlinePerLeg) {
deadlineEpochMillis = Utils.getCurrentTimeMillis() + readTimeoutMillis;
}
ensureConnected();
}
The configureTimeouts() re-call added by #197 can then go.
Poll mode (pollTimeout()) is unaffected: there the deadline is deliberately shared by every leg of one poll.
Test
StreamingApiTest: a command whose Receive the fake server answers late (close to the inactivity timeout) and then drops the connection, followed by a request that must reconnect; before the fix the reconnect fails with a connect timeout, after it the operation completes.
- 主要语言
- Java
- 星标
- 13
- 派生
- 4
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 15
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetricsHub/winrm-java 的其他 Issue
-
bug documentation
难度 2/5 1-3 小时 新手友好度 88/100
MetricsHub/winrm-java#202 ·
维护者通常 1 天内回复
-
enhancement
难度 3/5 1-2 天 新手友好度 58/100
MetricsHub/winrm-java#201 ·
维护者通常 1 天内回复
-
Streaming command fails with a spurious timeout when reconnecting after an idle pause可能已有人在做 @NassimBtk 于 1 天前认领。 未关闭
MetricsHub/winrm-java#198 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Long-lived `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal fails可能已有人在做 @NassimBtk 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
MetricsHub/winrm-java#196 · 4 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
MetricsHub/winrm-java#194 ·
维护者通常 1 天内回复
查看 MetricsHub/winrm-java 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 74/100
维护者通常 1 天内回复
-
team:Lumberjack
难度 2/5 1-3 小时 新手友好度 76/100
OpenLiberty/open-liberty#35998 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
Bug QWP
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100