Long-lived `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal fails
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 13
- Fork
- 4
- Merge trung bình
- 11 giờ 58 phút
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MetricsHub/winrm-java
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
MetricsHub/winrm-java#202 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
MetricsHub/winrm-java#199 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
MetricsHub/winrm-java#194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
MetricsHub/winrm-java#176 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MetricsHub/winrm-java
Issue tương tự
-
Use GHA setup gradle actionCó thể đã có người làm @bric3 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openhab/openhab-addons#21921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jellyfin/jellyfin-androidtv#5885 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:P2 product:orazaka type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày