feat(sg): respect the context when executing interrupt hooks#63069
Conversation
Intterupts hook are now split into two groups: - Sequential - Concurrent When hooks are executed now within a timeout context. Ensuring that we _still_ exit even if some hooks take too long. Also change max amount of interrupts signals we handle to be 5 since 2 felt a bit too short.
Isn't that why the 2nd sigint from the user terminates immediately using SIGKILLs?
Why is that? |
No - unfortunately not. That would be the more correct way to do it but a hook currently has no knowledge what signal was sent nor how many times a signal has been sent. We execute the same hooks regardless how many signals were sent 😬 So currently we handle it higher up since 99% of the use cases are people smashing
This is more as a failsafe. Technically now with the context timeout do not need to do this since we will exit but if something goes wrong there then ... smashing |
jamesmcnamara
left a comment
There was a problem hiding this comment.
I like the opt-in for concurrent execution!
During testing I found that sometimes some hooks would just hang and not complete. In this PR we execute all hooks within a timeout context. Ensuring we give some time for hooks to execute but also making sure we eventually exit if some hook is misbehaving.
Additional changes:
Test plan
Tested locally
Changelog