Skip to content

[πŸ’‘ FEATURE REQUEST]: Add graceful handling for SIGQUIT and SIGUSR2Β #2243

@koren88

Description

@koren88

Plugin

Temporal

I have an idea!

Currently, roadrunner-temporal handles SIGTERM and SIGINT gracefully β€” which works great for local development and containerized environments where Docker sends SIGTERM on stop.
However, when using Docker Swarm (and in some other orchestrators), services are stopped with a SIGQUIT instead of SIGTERM.

Unfortunately, RoadRunner doesn’t currently handle SIGQUIT, which causes it to exit abruptly with a Go runtime stack dump, bypassing Temporal worker shutdown and leaving workflows mid-execution.

https://github.com/temporalio/roadrunner-temporal/blob/b58d4f8cb37ecd69ad897a1948138d37301fa585/tests/general/plugin_status_test.go#L52

What happens now

When sending SIGTERM:

stop signal received, grace timeout is: 30 seconds
Stopped Worker {"Namespace": "default", "TaskQueue": "default", "WorkerID": "..."}

When sending SIGQUIT:

SIGQUIT: quit
PC=0x484fe1 m=0 sigcode=0
goroutine 0 gp=0x3b9fda0 m=0 mp=0x3ba16e0 [idle]:
runtime.futex(...)

Temporal workers never get a chance to finish or clean up.

Proposed enhancement

Add proper handling for:

  • SIGQUIT β†’ Treat as graceful stop (same as SIGTERM), with respect to grace timeout.
  • SIGUSR2 β†’ Allow reload or rolling restart (used in some managed systems for log rotation or controlled reloads).

Metadata

Metadata

Assignees

Labels

C-feature-acceptedCategory: Feature discussed and accepted

Projects

Status

βœ… Done

Relationships

None yet

Development

No branches or pull requests

Issue actions