Support custom graceful timeout for Sidekiq Cluster processes
What does this MR do?
Considering we're moving towards using Sidekiq Cluster
only (gitlab-com/gl-infra&181 (closed)) and customers using Omnibus are allowed to configure
a Sidekiq timeout through sidekiq['timeout']
(which is then given to bundle exec sidekiq -t
),
here we support a -t
(or --timeout
) flag for bin/sidekiq-cluster
.
Here's how it works:
Internally, we'll pass the given value to Sidekiq (-t
) flag.
For whatever value given, Sidekiq Cluster will wait for 5
extra seconds in order to hard stop all remaining alive processes.
So for instance, if 10
is given, Sidekiq will try to gracefully
terminate within this time. If it gets stuck for some reason, the
processes will be sigkilled within 15
seconds (total wait time).
gitlab-com/gl-infra/scalability#222 (closed)
Example:
› bin/sidekiq-cluster -t 20 'merge' 'merge' --dryrun
bundle exec sidekiq -c2 -edevelopment -t20 -gqueues:merge -r/Users/osw/projects/gitlab/gdk-ee/gitlab -qmerge,1
bundle exec sidekiq -c2 -edevelopment -t20 -gqueues:merge -r/Users/osw/projects/gitlab/gdk-ee/gitlab -qmerge,1
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team