Overlapping Signals¶
flagman attempts to handle overlapping signals in an intelligent manner. A signal is “overlapping” if it arrives while actions for previously-arrived signals are still running.
flagman handles overlapping signals of the same identity by coalescing and of different identities by handling them serially but in a non-guaranteed order.
For example, take the following sequence of events.
- flagman is sleeping awaiting a signal to arrive
SIGUSR1arrives- a long-running action for
SIGUSR1starts SIGUSR2arrives- the long-running action for
SIGUSR1finishes - a long-running action for
SIGUSR2starts SIGUSR1arrivesSIGUSR2arrives; it is ignored since theSIGUSR2actions are currently runningSIGHUParrives- the long-running action for
SIGUSR2finishes - a short-running action for
SIGUSR2starts and finishes - a short-running action for
SIGHUPstarts and finishes; note thatSIGHUParrived after the most recentSIGUSR1– only intra-signal action ordering is guaranteed - a long-running action for
SIGUSR1starts - the long-running action for
SIGUSR1finishes - flagman returns to sleep until the next handled signal arrives