Streaming reconnect runs under the previous leg's expired deadline (1 ms connect budget)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- java
- Domínio
- backend, networking
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Java
- Estrelas
- 13
- Forks
- 4
- Merge médio
- 7h 38min
- PRs com merge (30d)
- 14
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de MetricsHub/winrm-java
-
bug documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
MetricsHub/winrm-java#202 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
MetricsHub/winrm-java#201 ·
Mantenedores costumam responder em até 1 dia
-
Streaming command fails with a spurious timeout when reconnecting after an idle pauseTalvez já em andamento @NassimBtk assumiu há 1 dia. Aberta
MetricsHub/winrm-java#198 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Long-lived `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal failsTalvez já em andamento @NassimBtk assumiu hoje. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
MetricsHub/winrm-java#196 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
MetricsHub/winrm-java#194 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de MetricsHub/winrm-java
Issues semelhantes
-
backend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
bcgov/nr-forest-client#2524 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Sinytra/ForgifiedFabricAPI#298 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
team:Lumberjack
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
OpenLiberty/open-liberty#35998 ·
Mantenedores costumam responder em até 1 dia