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.
There's a race condition between sending the shutdown message and waiting for the "shutdown finished" signal to come back. Instead use a shared CondVar which is not racy.
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.
We don't want to touch the process name if we're integrating
Sidekiq into existing process, so better not to put procline
assignment in Manager, but in CLI where we launch standalone
Sidekiq process.