reactor-cpp icon indicating copy to clipboard operation
reactor-cpp copied to clipboard

Respond to CTRL+C SIGINT

Open lhstrh opened this issue 2 years ago • 2 comments

@zekailin00 found that when he attempts to interrupt the execution of his DeepRacer controller that uses the Cpp target, the program just keeps on running. Both Ctrl + C and Ctrl + D are ignored, and Ctrl + Z lets the program end abruptly (sometimes triggering a segfault). It is important to free up resources at the end of execution, or else things like GPIO pins become inaccessible during subsequent runs of the program, making debugging very onerous. Can we respond to Ctrl + C by initiating the shutdown sequence, like we're doing in reactor-c?

lhstrh avatar Mar 17 '23 21:03 lhstrh

Yes there are currently no OS signal handling. We were hesitant to implement this because this means a lot of macro magic to handle different operating systems. But can do

tanneberger avatar Apr 06 '23 10:04 tanneberger

I think it would be very useful to have it. I think the use case above alone is compelling...

lhstrh avatar Apr 06 '23 17:04 lhstrh