Unlike `Start-Job`, `Start-ThreadJob` doesn't respect a `Set-PSBreakpoint -Command` call in connection with `Debug-Job`
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- powershell
- 領域
- backend
調査の方向性
Start with the Start-ThreadJob reproduction and compare its breakpoint behavior with Start-Job and ForEach-Object -AsJob -Parallel. Read the thread job debugging and job state handling entry points, then trace why the breakpoint does not keep the thread job running for Debug-Job. Done means the reproduction enters the debugger at foo as expected.
索引モデルが issue の本文から書いたものです。
説明
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
-
When using
Set-PSBreakpoint -Commandfrom a background (child process-based) job, theSet-PSBreakpoint -Commandis honored (assuming that the job is already in theRunningstate - see https://github.com/PowerShell/PowerShell/issues/21258): the breakpoint suspends execution until theDebug-Jobcall connects. -
By contrast, with a thread job, that doesn't work: the thread job runs to completion, irrespective of the break point; the same applies to
ForEach-Object -AsJob -Parallel.
Write-Verbose -Verbose 'Creating a job that uses `Set-PSBreakpoint -Command foo`'
# NOTE: If you substitute `Start-Job` on the next line, the behavior is as expected.
$job = Start-ThreadJob {
function foo {
'hi'
}
Set-PSBreakpoint -Command foo
foo
}
Write-Verbose -Verbose 'Waiting an arbitrary amount of time (e.g., 3 seconds)...'
Start-Sleep 3
Write-Verbose -Verbose 'Initiating debugging...'
$job | Debug-Job
# Clean up.
$job | Remove-Job -Force
Expected behavior
Hit Command breakpoint on 'foo'
At line:3 char:16
+ function foo {
+
That is, the break point should be honored, irrespective of when Debug-Job is invoked,
and the debugger should be entered.
This is indeed how it works with a Start-Job (child process-based) job.
Actual behavior
Debug-Job: /path/to/some.ps1:42
Line |
19 | $job | Debug-Job
| ~~~~~~~~~
| The provided job and all child jobs were examined but no jobs were found that could be debugged. In order to debug a job or child job the job must support debugging and
| also be in a running state.
That is, the thread job ran to completion without honoring the break point, and the attempt to call Debug-Job came too late.
Error details
No response
Environment data
PowerShell 7.5.0-preview.3
Version
2.0.3, as shipped with PowerShell Core v7.5.0-preview.3
Visuals
No response
- 主要言語
- 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
-
Add TuneIn-DirMon in the bot list対応中かも @liviuconcioiu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
matomo-org/device-detector#8424 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK status対応中かも @leizhiyuan が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
apache/rocketmq-clients#1465 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
medusajs/dtc-starter#90 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
NVIDIA/flare-local-inference#90 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
zaidmukaddam/scira#261 ·