当工作节点重新启动时,运行 的 Sidekiq 作业会发生什么情况?
What happens Sidekiq jobs that are running when the worker node is restarted?
我们使用 Asgard 使用 Sidekiq 将我们的部署部署到 Rails 4 应用程序。我们想知道当部署正在进行并终止工作节点时队列中的作业会发生什么情况。
Sidekiq 的关闭过程是怎样的?它会重新排队无法完成的作业,还是会丢失 运行 作业的状态?
如果作业在停止信号后 8 秒内无法完成 - 它将被推送到 Redis 中并稍后重新启动。 Sidekiq wiki:
By default, Sidekiq gives workers 8 seconds to shut down. This is
carefully chosen because Heroku gives a process 10 seconds to shutdown
before killing it. After 8 seconds, any remaining jobs still in
progress are pushed back onto Redis so they can be immediately
restarted when Sidekiq starts back up. Remember that Sidekiq will run
your jobs AT LEAST once so they need to be idempotent. This is one
example of how a job can be run twice.
我们使用 Asgard 使用 Sidekiq 将我们的部署部署到 Rails 4 应用程序。我们想知道当部署正在进行并终止工作节点时队列中的作业会发生什么情况。
Sidekiq 的关闭过程是怎样的?它会重新排队无法完成的作业,还是会丢失 运行 作业的状态?
如果作业在停止信号后 8 秒内无法完成 - 它将被推送到 Redis 中并稍后重新启动。 Sidekiq wiki:
By default, Sidekiq gives workers 8 seconds to shut down. This is carefully chosen because Heroku gives a process 10 seconds to shutdown before killing it. After 8 seconds, any remaining jobs still in progress are pushed back onto Redis so they can be immediately restarted when Sidekiq starts back up. Remember that Sidekiq will run your jobs AT LEAST once so they need to be idempotent. This is one example of how a job can be run twice.