Long-lived `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal fails
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Start by reading WsmanClient.terminateCompleted() and the issue’s reproduction steps; the payload does not name a source file or test. Check open pull request #197 before starting, since work is already underway. Done means a failed terminate Signal triggers best-effort shell deletion and clears shellId, while the command result is still returned and the quota-1 reproduction can run another command.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Disclaimer: Although the following content is generated by AI, I have thoroughly reviewed and cleaned it.
Problem
A long-lived WinRMClient used for periodic polling can start failing every command with:
HTTP 500 (WSManFault 2150859174): The WS-Management service cannot process the request. The maximum number of concurrent operations for this user has been exceeded.
It never recovers on its own. Only closing the client and recreating it fixes the problem.
Cause
After a command completes, the client sends a Terminate Signal so the server releases the command's resources. According to [MS-WSMV] 2.2.4.38:
- http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/Terminate
This control code is sent by the client to acknowledge receipt of the end of the command output from the service and to clean up any resources associated with command execution. Because the service might have to cache this information until it knows that the client has received the entire stream, the client MUST send this before a new command can be executed.
When the server answers that Signal with a fault, WsmanClient.terminateCompleted() ignores it:
} catch (final WinRMFaultException ignored) {
// The Signal was answered with a fault: the exchange completed, the connection is in
// sync — and the command's completion is what matters.
}
As a result:
- The command is never terminated and keeps holding an operation of the user's quota (
MaxConcurrentOperationsPerUser). - The Signal is never retried, and the shell is kept and reused by the next commands.
- Each failed Signal leaves one more operation open. Once the quota is full, every Command is refused.
- Nothing releases those operations until the shell is deleted, which only happens in close() .
The failure is swallowed silently, so nothing in the logs shows the Signals failing before the quota errors start.
Reproduction
A FakeWsmanServer with an operation quota of 1 (a counter: +1 per accepted Command, −1 per accepted Terminate Signal, reset on shell Delete):
- Poll 1: Create, Command, Receive, then the terminate Signal fails. The poll still returns success.
- Poll 2: the Command reuses the same shell and is refused with WSManFault 2150859174.
Proposed Fix
When the terminate Signal fails, delete the shell (best effort) and clear shellId. Deleting the shell releases the command still open in it, and the next command creates a fresh shell. The caller still gets the command's result.
- Linguagem predominante
- Java
- Estrelas
- 15
- Forks
- 4
- Merge médio
- 11h 58min
- PRs com merge (30d)
- 20
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
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 78/100
MetricsHub/winrm-java#199 ·
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
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
MetricsHub/winrm-java#176 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de MetricsHub/winrm-java
Issues semelhantes
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Abertatype: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
carlos-emr/carlos#4933 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/rocketmq-dashboard#6925 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Vakore/ZappierGames#147 ·
-
Post 1.11.2 to SpigotMCAbertaspigotmc
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Dans-Plugins/Wild-Pets#356 ·
Mantenedores costumam responder em até 1 dia
-
Post 1.16.2 to SpigotMCAbertaspigotmc
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Dans-Plugins/Medieval-Roleplay-Engine#371 ·
Mantenedores costumam responder em até 1 dia