tusk icon indicating copy to clipboard operation
tusk copied to clipboard

terminating a subprocess kills tusk without running Finally block

Open cuotos opened this issue 5 years ago • 2 comments

I've got a task that runs a go binary until killed by the user, that binary is listen to SIGINT and SIGTERM in order to perform from cleanup operations.

So I understand correctly, if I start the app with Tusk, and kill it with ctrl+c, I kill Tusk, and "interrupt" is sent to my binary which does its cleanup. But Tusk gets killed and will not run its Finally code.

Is there any way I can pass the ctrl+c to the running process and not kill tusk instantly?

cuotos avatar Dec 31 '19 15:12 cuotos

I don't believe this is currently possible.

That said, allowing finally clauses to run after a SIGINT is probably better in general. I think it makes the most sense to make that the default behavior, and maybe a second SIGINT kills tusk.

rliebz avatar Dec 31 '19 15:12 rliebz

That would be nice. If the initial SIGINT kills the sub process. In my case the "finally" would then run and do the cleanup. For now I'll move the "finally" logic into my app.

cuotos avatar Dec 31 '19 20:12 cuotos