Trying to understand the signals sent by Intellij's stop button better
Answered
My program has an issue where the first press of the stop button in intellij (specifically gogland) does not stop the process. The second press of the button sends a kill -9 to the process and it is terminated. Through testing in the terminal, I have run and stopped my terminal-started program by sending a kill -2, -9, and -15 to it. They all worked on the first try. What signal is being sent to my program on the first press of the stop button in intellij?
Please sign in to leave a comment.
It should be SIGINT, but may depend on the specific Run/Debug configuration type (not sure how Gogland handles it):
https://github.com/JetBrains/intellij-community/blob/544eea25e133d69a62e2109528af0486e0d6e472/platform/platform-impl/src/com/intellij/execution/process/KillableProcessHandler.java#L152
Developers told me that Gogland does the same, it sends SIGINT and then SIGKILL on the second press, see https://youtrack.jetbrains.com/issue/GO-2899.
Interesting. Alright thanks for the quick replies!