Skip to content

Commit dd68a9c

Browse files
andyundsorosa
authored andcommitted
Remove trapping QUIT on Windows
1 parent ecc170c commit dd68a9c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ The supervisor is in charge of managing these processes, and it responds to the
373373

374374
When receiving a `QUIT` signal, if workers still have jobs in-flight, these will be returned to the queue when the processes are deregistered.
375375

376+
On Windows, the `QUIT` signal can't be trapped, so the supervisor only responds to `TERM` and `INT` there.
377+
376378
If processes have no chance of cleaning up before exiting (e.g. if someone pulls a cable somewhere), in-flight jobs might remain claimed by the processes executing them. Processes send heartbeats, and the supervisor checks and prunes processes with expired heartbeats. Jobs that were claimed by processes with an expired heartbeat will be marked as failed with a `SolidQueue::Processes::ProcessPrunedError`. You can configure both the frequency of heartbeats and the threshold to consider a process dead. See the section below for this.
377379

378380
In a similar way, if a worker is terminated in any other way not initiated by the above signals (e.g. a worker is sent a `KILL` signal), jobs in progress will be marked as failed so that they can be inspected, with a `SolidQueue::Processes::ProcessExitError`. Sometimes a job in particular is responsible for this, for example, if it has a memory leak and you have a mechanism to kill processes over a certain memory threshold, so this will help identifying this kind of situation.

‎lib/solid_queue/supervisor/signals.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Signals
1111
end
1212

1313
private
14-
SIGNALS = %i[ QUIT INT TERM ]
14+
SIGNALS = Gem.win_platform? ? %i[ INT TERM ] : %i[ QUIT INT TERM ]
1515

1616
def register_signal_handlers
1717
SIGNALS.each do |signal|

0 commit comments

Comments
 (0)