In environments with deterministic hostnames and PIDs (i.e. Heroku), the
current system for constructing a process's identity string produces
collisions (e.g. a new process can assume the identity of one that has
died). In order to address this, we add a random string to the identity string.
Issue #2071.
a matching heartbeat record, indicating that they're no longer alive.
Added call to this new util method in the Schedule::Poller.poll_interval
method because the number of live processes is used as a multiplier for
the default wait interval. Since the value for poll_interval is
memoized this call to 'cleanup_dead_process_records' should only be
called once at startup.
We no longer have a global 'workers' set but rather a global 'processes' set. Each process has its own workers hash, keyed by thread id.
Rely as much as possible on Redis key expiration to naturally prune any lingering data. Process data only has a one minute TTL, with the heartbeat refreshing the TTL, so it will expire quickly after a process dies.
the client use separate pools.
This is so the Rails app Sidekiq::Client and
Sidekiq::Manager can use different configurations.
Also, fix issue where workers were not unregistered
in Redis upon shutdown.