Long-lived `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal fails
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Java
- Sterne
- 15
- Forks
- 4
- Ø Merge
- 11 Std. 58 Min.
- Gemergte PRs (30 T.)
- 20
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus MetricsHub/winrm-java
-
bug documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
MetricsHub/winrm-java#202 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
MetricsHub/winrm-java#199 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
MetricsHub/winrm-java#194 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
MetricsHub/winrm-java#176 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in MetricsHub/winrm-java
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
apache/rocketmq-dashboard#7039 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
pdfium-drift
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Stirling-Tools/JPDFium#176 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Guidelines: redundant use cases, stale dev bundle after snapshot bumps, looking up snapshot APIEvtl. vergeben @totally-not-ai hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
vaadin/use-cases#441 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
hiero-ledger/hiero-consensus-node#27712 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 61/100
Vakore/ZappierGames#162 ·