runner.pm: apply minor correctness fix#21672
Conversation
Lines 244-245 overwrite global variables `$runnerr` and `$runnerw` that were already assigned in the child process (lines 205-206). In the parent process context, these assignments appear incorrect and could cause issues if `runner_init` is called multiple times. The parent should only store references in the controller hashes. Spotted and fixed by GitHub Code Quality
There was a problem hiding this comment.
Pull request overview
This PR prevents the parent/controller process from overwriting runner-side pipe globals when runners are initialized in multiprocess mode.
Changes:
- Limits
$runnerrand$runnerwassignment to integrated single-process mode. - Preserves per-runner controller pipe storage for both modes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
They seem to me to be unnecessary, but harmless.
I don't see that as ever being an issue. This function isn't casually called to initialize an empty struct but rather to spawn a new worker, which has side effects that would be hard to ignore.
This patch may help clarify the intent of the code, since
|
|
Thanks for reviewing, Dan. I've merged! |
"Lines 244-245 overwrite global variables `$runnerr` and `$runnerw` that were already assigned in the child process (lines 205-206). In the parent process context, these assignments appear incorrect and could cause issues if `runner_init` is called multiple times. The parent should only store references in the controller hashes." It could never cause an actual issue, but clarifies the intent of the code. Spotted and fixed by GitHub Code Quality Cherry-picked from curl#21646 Closes curl#21672
"Lines 244-245 overwrite global variables
$runnerrand$runnerwthatwere already assigned in the child process (lines 205-206). In the
parent process context, these assignments appear incorrect and could
cause issues if
runner_initis called multiple times. The parentshould only store references in the controller hashes."
It could never cause an actual issue, but clarifies the intent of the
code.
Spotted and fixed by GitHub Code Quality
Cherry-picked from #21646
https://github.com/curl/curl/pull/21672/files?w=1