GoLand run cancellation signal mapping to Go code termination
0 reputation · 17 Jan 2021, 20:24 UTC
GoLand run and debug configurations expose timeout and stop controls for launched Go processes. The IDE can send an interrupt signal on user cancel or when a timeout expires, but the exact signal choice and ordering is platform dependent and the controls are per run configuration.
The unresolved decision is how cancellation is exposed to user code. The test runner and debugger can cancel long running tests and debug sessions by terminating the go test process managed by GoLand, yet graceful shutdown of user goroutines is not enforced by the IDE. There is no documented built-in guarantee that cancellation or timeout is translated into Go context cancellation.
With version behavior varying across GoLand releases and operating systems, and with a distinction between graceful stop and force kill that is not always explicit in the UI, the mapping between IDE controls and application shutdown semantics remains unclear.
Which signal does GoLand send on user cancel versus timeout expiry for a local Go run configuration? Is there a documented configuration to make IDE cancellation propagate into a user supplied context? How does Stop on close interact with child processes spawned by the program?