Job results (from Receive-Job) are grouped by output type, differently than "normal" (BackgroundJob) jobs
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- powershell
- 領域
- backend
調査の方向性
The issue shows the behavior with Start-ThreadJob and Receive-Job on PowerShell 7.4.5 and ThreadJob 2.1.0. Start by reproducing the example and comparing its output order with Start-Job. Trace how ThreadJob collects and exposes the different output streams; done means Receive-Job preserves the order of interleaved output types.
索引モデルが issue の本文から書いたものです。
説明
Consider the following code which starts a ThreadJob:
$job = Start-ThreadJob -ScriptBlock {
for( $i = 0 ; $i -lt 100 ; $i++ )
{
Write-Output "output $i"
Write-Host "host output $i"
Write-Information "info output $i"
Write-Verbose "verbose output $i"
Write-Warning "warning output $i"
Start-Sleep -Seconds 5
}
}
If I receive results of the job, the output is grouped according to the type of output:
PS C:\Users\me> Receive-Job $job
output 0
output 1
output 2
WARNING: warning output 0
WARNING: warning output 1
WARNING: warning output 2
host output 0
host output 1
host output 2
PS C:\Users\me>
This is in contrast to “normal” jobs—if I switch the call out for Start-Job, the results come in a more expected order:
PS C:\Users\me> Receive-Job $job
output 0
host output 0
WARNING: warning output 0
output 1
host output 1
WARNING: warning output 1
output 2
host output 2
WARNING: warning output 2
PS C:\Users\me>
Expected behavior
I expect the output from Receive-Job of a ThreadJob to come in the same order as from a BackgroundJob.
This is because I expect to be able to use thread jobs as a "drop-in" replacement for background jobs (modulo restrictions imposed due to running in the same process, like of course you wouldn't be able to load different versions of .NET assemblies).
Actual behavior
The output from a ThreadJob is all grouped by output type (all Warnings grouped together, all host output grouped together, etc.).
Environment data
Name Value
---- -----
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS Microsoft Windows 10.0.26290
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Users\me> gmo *thread*
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 2.1.0 Microsoft.PowerShell.ThreadJob Start-ThreadJob
Version
7.4.5 / 2.1.0
- 主要言語
- PowerShell
- スター
- 37
- フォーク
- 22
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/ThreadJob のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
PowerShell/ThreadJob#59 · リアクション 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
PowerShell/ThreadJob#56 · リアクション 1 件 ·
-
Set alias for ThreadJob command(s)対応中かも @kilasuit が 80 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
PowerShell/ThreadJob#45 · コメント 1 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 48/100
PowerShell/ThreadJob#44 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
PowerShell/ThreadJob#43 ·
PowerShell/ThreadJob の issue をすべて見る
似ている issue
-
difficulty: easy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
bug priority: P3 ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
shep-pm/shep-kelpie#1332 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aristocratos/btop#1945 ·
メンテナーはふだん 2 日以内に返信