Closed (fixed)
Project:
Waiting queue
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
22 Sep 2011 at 01:33 UTC
Updated:
21 Sep 2021 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sdboyer commentedgiven that the goal here is pretty much by definition to force the reboot externally, I can't think of another way to do it apart from signal handlers that would be simple, effective, and scalable (and really, this is what signals are *for*). the only other alternative I can even think of is some sort of db-recorded timestamp which the workers individually check whenever
claimItem()finishes, and compare against their own start time. i don't really like that, though, as a) it means an extra query for every job and b) potentially a *lot* of concurrent queries on that table.But most importantly, because there are other reasons we might want to force a restart. Signals are the generic solution to that problem, so that's the way we should go.
and...I GUESS we separate it so that we can be cognizant of Windows compatibility. Meh. :P
Comment #3
Anonymous (not verified) commentedpatch against 7.x, will backport to 6.x when we're happy.
Comment #4
msonnabaum commentedLooks good to me. Should we also handle SIGINT though?
Comment #5
Anonymous (not verified) commentedwhen writing the patch i was thinking we should make the signal(s) that will trigger a reboot configurable. the emphasis is on not forcing the use of a particular signal on people using workers, rather than on being a general purpose signal handling setup.
attached patch makes the signals the will cause a reboot configurable, and defaults to SIGTERM.
Comment #6
sdboyer commentedI think I'd rather see the object install the signal handlers on itself (say in a
installHandlers()method). Haven't found a way to remove them, but if there is one, then it should be triggered in the object's__destruct().Also should put in at least nominal winblows support. Or at least an
if function_exists(pcntl_signal()) { ... } else { watchdog() }type of thing.Comment #7
Anonymous (not verified) commentedok, i agree with the object installing the handlers itself.
not sure i care about windows support, but it's definitely worth checking for pcntl_signal. working up patch now...
Comment #8
Anonymous (not verified) commentedhere it is.
Comment #9
sdboyer commented+1.
...though i don't actually have a good spot to test this. have you? :)
Comment #10
Anonymous (not verified) commentedhttp://drupalcode.org/project/waiting_queue.git/commit/aee767d
finally got around to this...