Skip to content

processhelp.pm: always call taskkill with -f (force) #17054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Apr 14, 2025

In the hope this avoid a possible hang in taskkill.

To kill processes, runtests first tries to kill them gently (with
"TERM", or on Windows taskkill), then waits some time for them
to disappear and then kills them with KILL, or on Windows with
taskkill -f. This happens within killpid().

This patch bumps the gentle phase to taskkill -f. On the obervation
that a non-forced taskkill may hang in cases:

msvc, CM x64-windows wolfssl +examples:

  [...]                                                    
  test 3006...[SMTP with multiple invalid (all) --mail-rcpt and --mail-rcpt-allowfails]
  --p----e--- OK (1682 out of 1718, remaining: 00:04, took 0.524s, duration: 03:13)
  test 3005...[SMTP with multiple and invalid (all but one) --mail-rcpt and --mail-rcpt-allowfails]
  --p-u--e-Executing: 'taskkill -t -pid 1196 >nul 2>&1'    

Ref: https://github.com/curl/curl/actions/runs/14445993473/job/40508986059?pr=17051#step:15:4176

Cancelling the job worked, resulting in a greyed out status, with the above
step and log entries lost.

If this change causes issues or does nothing at all, we may revert it
or limit it to CI runs.

Ref: #14854 (comment)

@vszakats vszakats changed the title processhelp.pm: always call taskkill with -f processhelp.pm: always call taskkill with -f (force) Apr 14, 2025
@github-actions github-actions bot added the tests label Apr 14, 2025
@vszakats vszakats added the Windows Windows-specific label Apr 14, 2025
@vszakats vszakats closed this in 4e203f6 Apr 14, 2025
@vszakats vszakats deleted the taskkill-f-always branch April 14, 2025 23:21
nbaws pushed a commit to nbaws/curl that referenced this pull request Apr 26, 2025
In the hope this avoid a possible hang in `taskkill`.

To kill processes, `runtests` first tries to kill them gently (with
"TERM", or on Windows `taskkill`), then waits some time for them
to disappear and then kills them with `KILL`, or on Windows with
`taskkill -f`. This happens within `killpid()`.

This patch bumps the gentle phase to `taskkill -f`. On the obervation
that a non-forced `taskkill` may hang in cases:

msvc, CM x64-windows wolfssl +examples:
```
  [...]
  test 3006...[SMTP with multiple invalid (all) --mail-rcpt and --mail-rcpt-allowfails]
  --p----e--- OK (1682 out of 1718, remaining: 00:04, took 0.524s, duration: 03:13)
  test 3005...[SMTP with multiple and invalid (all but one) --mail-rcpt and --mail-rcpt-allowfails]
  --p-u--e-Executing: 'taskkill -t -pid 1196 >nul 2>&1'
```
Ref: https://github.com/curl/curl/actions/runs/14445993473/job/40508986059?pr=17051#step:15:4176

Cancelling the job worked, resulting in a greyed out status, with the above
step and log entries lost.

If this change causes issues or does nothing at all, we may revert it
or limit it to CI runs.

Ref: curl#14854
Closes curl#17054
nbaws pushed a commit to nbaws/curl that referenced this pull request Apr 26, 2025
In the hope this avoid a possible hang in `taskkill`.

To kill processes, `runtests` first tries to kill them gently (with
"TERM", or on Windows `taskkill`), then waits some time for them
to disappear and then kills them with `KILL`, or on Windows with
`taskkill -f`. This happens within `killpid()`.

This patch bumps the gentle phase to `taskkill -f`. On the obervation
that a non-forced `taskkill` may hang in cases:

msvc, CM x64-windows wolfssl +examples:
```
  [...]
  test 3006...[SMTP with multiple invalid (all) --mail-rcpt and --mail-rcpt-allowfails]
  --p----e--- OK (1682 out of 1718, remaining: 00:04, took 0.524s, duration: 03:13)
  test 3005...[SMTP with multiple and invalid (all but one) --mail-rcpt and --mail-rcpt-allowfails]
  --p-u--e-Executing: 'taskkill -t -pid 1196 >nul 2>&1'
```
Ref: https://github.com/curl/curl/actions/runs/14445993473/job/40508986059?pr=17051#step:15:4176

Cancelling the job worked, resulting in a greyed out status, with the above
step and log entries lost.

If this change causes issues or does nothing at all, we may revert it
or limit it to CI runs.

Ref: curl#14854
Closes curl#17054
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Windows Windows-specific
Development

Successfully merging this pull request may close these issues.

1 participant