User is promted a second time when force terminating with ^C
Summary
When the user decides to terminate the build forcefully, BuildStream asks the user again if they want to terminate instead of just going ahead and terminating.
Steps to reproduce
- Start a build
- Hit
^C - BuildStream will give you a prompt, informing you that if you choose to terminate or hit
^Cagain, it will terminate all tasks and exit - Hit
^Cagain - BuildStream now says were "Terminating all jobs at user request"... so far so good
- Now BuildStream does terminate the jobs
- But, there are messages which indicate that maybe we double-terminated them, these messages are from python core and say "Unknown child process pid 13280, will report returncode 255"
- Now we get another, second prompt, saying again "User interrupted with ^C"
- We can no longer hit
^C, because we blockSIGINTintentionally so that the user cannot interrupt our termination of tasks - At this point, if you hit
ENTER, BuildStream will "Continue", and this will finally result in termination
What is the current bug behavior?
We are falling into the SIGINT trap a second time, even though we already terminated
What is the expected correct behavior?
We should not get asked a second time after terminating tasks.
Relevant logs and/or screenshots
Here is the output of a sample session:
User interrupted with ^C
Choose one of the following options:
(c)ontinue - Continue queueing jobs as much as possible
(q)uit - Exit after all ongoing jobs complete
(t)erminate - Terminate any ongoing jobs and exit
Pressing ^C again will terminate jobs and exit
Choice: [continue]: ^C
Terminating all jobs at user request
[--:--:--][0ea88a4b][ main:sdk/gtk+-3.bst ] STATUS Pull terminating
[--:--:--][0ca2699c][ main:sdk/fcitx.bst ] STATUS Pull terminating
[--:--:--][f7fcc6ed][ main:sdk/sdl2.bst ] STATUS Pull terminating
[--:--:--][4677d74b][ main:sdk/ffmpeg.bst ] STATUS Pull terminating
[--:--:--][09e1bccf][ main:sdk/geoclue.bst ] STATUS Pull terminating
[--:--:--][43069f6c][ main:sdk/gst-libav.bst ] STATUS Pull terminating
[--:--:--][38935dcd][ main:core-deps/NetworkManager.bst ] STATUS Pull terminating
[--:--:--][2733fc38][ main:sdk/WebKitGTK+.bst ] STATUS Pull terminating
[--:--:--][cdb31ebf][ main:core-deps/libgsf.bst ] STATUS Pull terminating
[--:--:--][d8e26177][ main:sdk/gcr.bst ] STATUS Pull terminating
Unknown child process pid 13280, will report returncode 255
Unknown child process pid 13298, will report returncode 255
Unknown child process pid 13268, will report returncode 255
Unknown child process pid 13270, will report returncode 255
Unknown child process pid 13272, will report returncode 255
Unknown child process pid 13284, will report returncode 255
Unknown child process pid 13290, will report returncode 255
Unknown child process pid 13276, will report returncode 255
Unknown child process pid 13300, will report returncode 255
Unknown child process pid 13294, will report returncode 255
User interrupted with ^C
Choose one of the following options:
(c)ontinue - Continue queueing jobs as much as possible
(q)uit - Exit after all ongoing jobs complete
(t)erminate - Terminate any ongoing jobs and exit
Pressing ^C again will terminate jobs and exit
Choice: [continue]: ^C
Terminating all jobs at user request
[00:00:15][][] WARNING Build Terminated
Pipeline Summary
Total: 489
Session: 136
Pull Queue: processed 0, skipped 10, failed 0
Fetch Queue: processed 0, skipped 0, failed 0
Build Queue: processed 0, skipped 0, failed 0
Possible fixes
Other relevant information
- BuildStream version affected: /milestone %BuildStream_v1.x