Unlike `Start-Job`, `Start-ThreadJob` doesn't respect a `Set-PSBreakpoint -Command` call in connection with `Debug-Job`
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- powershell
- Domínio
- backend
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- PowerShell
- Estrelas
- 37
- Forks
- 22
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/ThreadJob
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
PowerShell/ThreadJob#59 · 1 reação ·
-
enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 56/100
PowerShell/ThreadJob#56 · 1 reação ·
-
Set alias for ThreadJob command(s)Talvez já em andamento @kilasuit assumiu há 80 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 20/100
PowerShell/ThreadJob#45 · 1 comentário ·
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 48/100
PowerShell/ThreadJob#44 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
PowerShell/ThreadJob#43 ·
Todas as issues de PowerShell/ThreadJob
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Merit-Systems/x402scan#1312 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
developmentseed/titiler-cmr#265 ·
Mantenedores costumam responder em até 1 dia
-
Insecure Brotli version <1.2.1Talvez já em andamento @jamescw19 assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
stac-utils/stac-fastapi-pgstac#438 · 1 reação ·
-
[deliverclient] Remove the unused common/deliverclient packageTalvez já em andamento @liran-funaro assumiu hoje. Abertacode-hygiene
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
hyperledger/fabric-x-common#236 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
linagora/twake-calendar-side-service#1218 · 1 comentário ·
Mantenedores costumam responder em até 1 dia