Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#196 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@NassimBtk がすでに取り組んでいます。

2026年10月8日 から。

  • #197 @NassimBtk による — マージ済み

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
13
フォーク
4
平均マージ
11時間 58分
マージ済み PR(30日)
20

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MetricsHub/winrm-java のほかの issue

MetricsHub/winrm-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。