Feat!: cancel submitted BigQuery jobs on keyboard interrupts#4979
Feat!: cancel submitted BigQuery jobs on keyboard interrupts#4979georgesittas merged 6 commits intomainfrom
Conversation
|
Discussed internally and concluded there may be a better way to deal with this: aggregate initiated jobs in a set attribute, and upon |
c2b6739 to
2a5b223
Compare
bbc101a to
55a568d
Compare
1083eed to
f1809d8
Compare
|
@izeigerman addressed the latest feedback round here:
|
8a0dd98 to
3e443a9
Compare
|
FMI: will this also be executed upon |
3e443a9 to
76cd59a
Compare
76cd59a to
88a3501
Compare
|
Hey @plaflamme 👋! Apologies for the delay, just got back from vacation.
I believe so:
Does this answer your question? |
|
@georgesittas Thanks for the reply!
I'm not a python expert, but normally, this is only true if the application actually handles the signal. Perhaps that's already in place? |
|
Hmm, I'm actually not sure if the
I don't think we register a handler for |
|
Ok yeah, it's not reached... Quick script to reproduce: @izeigerman any thoughts re: handling |
FWIW: if an SCD2 query is running when |
|
Perhaps we could register a |
|
@plaflamme FYI I merged this without dealing with |
This PR aims to address the following problem: suppose a plan is submitted, resulting in a BigQuery job submission to evaluate a model, followed by a keyboard interrupt issued by the user (e.g., CTRL-C / SIGINT is sent from the terminal).
Today we don't cancel the job, meaning that long-running jobs will be left orphaned to run in BigQuery, despite the plan being cancelled. This may result in needless computation (i.e., cost), and so in this PR we
intercept the keyboard interruptkeep track of pending jobs and send a cancellation request upon closing the adapter, unless the jobs are already completed by that point.