Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Long-lived  `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal fails

Đã đóng
#196 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@NassimBtk đang làm issue này rồi.

Từ ngày 8/10/2026.

  • #197 của @NassimBtk — đã merge

Đá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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend

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:

  1. The command is never terminated and keeps holding an operation of the user's quota (MaxConcurrentOperationsPerUser).
  2. The Signal is never retried, and the shell is kept and reused by the next commands.
  3. Each failed Signal leaves one more operation open. Once the quota is full, every Command is refused.
  4. 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):

  1. Poll 1: Create, Command, Receive, then the terminate Signal fails. The poll still returns success.
  2. 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MetricsHub/winrm-java

Tất cả issue của MetricsHub/winrm-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.