---
title: "Surviving rolling deploys when Sidekiq meets a class it doesn't know yet"
url: https://daily.dev/posts/surviving-rolling-deploys-when-sidekiq-meets-a-class-it-doesn-t-know-yet-tjkfdn3dg
source_url: https://dmitrytsepelev.dev/sidekiq-requeue-missing-class
type: article
source: "RUBYLAND"
published: 2026-07-07T09:55:08.781Z
updated: 2026-07-07T09:55:32.623Z
tags: ["rails"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Surviving rolling deploys when Sidekiq meets a class it doesn't know yet

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 7 min read · 0 upvotes · 0 comments

## Summary

Rolling deploys create a race condition where newly enqueued Sidekiq jobs reference a class that old worker processes haven't loaded yet, causing NameError crashes. The standard fix—two-phase deploys or feature flags—works but adds manual overhead to every deploy. The author built sidekiq-requeue_missing_class, a Sidekiq server middleware gem that intercepts jobs with unresolvable class names and requeues them with a configurable delay instead of raising. It handles both native Sidekiq and ActiveJob payloads, uses Object.const_get (the same path Sidekiq uses) so Rails autoloading works correctly, and gives up after a configurable max_requeues count so genuinely broken class names still surface as real errors. The gem doesn't help with incompatible argument changes—that still requires two-phase deploys.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dmitrytsepelev.dev/sidekiq-requeue-missing-class>

## Similar posts on daily.dev

- [Dynamic Ruby And Hidden Maintenance Costs](https://daily.dev/posts/dynamic-ruby-and-hidden-maintenance-costs-jnxrbecmr) · RUBYLAND · 0 upvotes · 0 comments
- [Fair by design: orchestrating background jobs in Ruby—Martian Chronicles, Evil Martians’ team blog](https://daily.dev/posts/fair-by-design-orchestrating-background-jobs-in-ruby-martian-chronicles-evil-martians-team-blog-piyszlqky) · Martian Chronicles · 0 upvotes · 0 comments
- [Idempotent Background Workers for LLM Calls in Rails — Danial Asghar](https://daily.dev/posts/idempotent-background-workers-for-llm-calls-in-rails-danial-asghar-ic5brx4vx) · Ruby Flow · 0 upvotes · 0 comments
- [Enhancing job reliability with Sidekiq Pro's super fetch strategy](https://daily.dev/posts/enhancing-job-reliability-with-sidekiq-pro-s-super-fetch-strategy-f3cx6mko3) · thoughbot · 0 upvotes · 0 comments
- [Everything you should know about Background Jobs with ActiveJob](https://daily.dev/posts/everything-you-should-know-about-background-jobs-with-activejob-uxyudjznl) · The Miners · 0 upvotes · 0 comments

---

Tags: [#rails](https://daily.dev/tags/rails)

[View this post on daily.dev](https://daily.dev/posts/surviving-rolling-deploys-when-sidekiq-meets-a-class-it-doesn-t-know-yet-tjkfdn3dg)
