PhoenixKit 1.7.212: Oban Lifeline rescues jobs stuck after a crash
PhoenixKit 1.7.212 adds Oban’s Lifeline plugin to the app’s Oban configuration, so background jobs left “executing” by a hard crash are picked up again.
Without Lifeline, a job interrupted by a killed process, an out-of-memory error or a lost node stays marked as executing forever. For a unique worker, that one stuck job can block every new job of the same kind. mix phoenix_kit.install now writes {Oban.Plugins.Lifeline, rescue_after: :timer.minutes(60)}, and mix phoenix_kit.update adds it to an existing config. Sixty minutes is above the longest job PhoenixKit ships, so a slow job is not run twice. mix phoenix_kit.doctor warns when Lifeline is missing, and no longer fails on queues: false or plugins: false.
mix phoenix_kit.update also stops misplacing the cron plugin when the plugins: list holds an entry with a list option.
Upgrading
Run mix phoenix_kit.update to add Lifeline to your config.exs.
Full release notes: PhoenixKit 1.7.212
1.7.212 · 26 July 2026
Added
Oban.Plugins.Lifelineshipped to host apps (PR #662). The Oban configmix phoenix_kit.installgenerates now carries{Oban.Plugins.Lifeline, rescue_after: :timer.minutes(60)}, andmix phoenix_kit.updatebackfills it into an existing host config via the newPhoenixKit.Install.ObanConfig.ensure_lifeline_plugin/2. Without it a job orphaned in:executingby a hard crash (kill -9, OOM, node loss) is never returned to:available— and for a unique worker whosestates:includes:executing, that orphan permanently blocks every future insert for the worker, not just the crashed job.mix phoenix_kit.doctorwarns when the host’s running Oban config has no Lifeline plugin, pointing atmix phoenix_kit.updateas the remedy.
Changed
bandit1.12.1 → 1.12.3.
Fixed
- Post-merge review of PR #662 (
dev_docs/pull_requests/2026/662-oban-lifeline-installer/):rescue_afterraised 30 → 60 minutes. Lifeline rescues purely by elapsed time and never checks whether the executing node is still alive, sorescue_aftermust exceed the longest job the host can legitimately run. PhoenixKit itself ships a 30-minute worker (Storage.Workers.SyncFilesJob), and every worker without atimeout/1callback has no bound at all — at 30 minutes a long newsletters-delivery, shop-import or sitemap run would be flipped back to:availableand re-executed concurrently with the still running original (duplicate emails on the delivery queue). 60 minutes is Oban’s own default and 2× the longest declared timeout. The invariant is now documented in the generatedconfig.exscomment and locked by a test that asserts the emitted value exceeds every shipped worker’stimeout/1.add_cron_plugin_to_plugins/2no longer matches its plugins-block close with the un-anchored\n[ \t]+\], which binds to the first nested list’s bracket — the same corruption PR #662 fixed inensure_lifeline_plugin/2but left in its sibling. A host whoseplugins:list contains an entry with a list option ({Oban.Plugins.Reindexer, indexes: [...]}, Oban Web’s stats plugin) would have had itsconfig.exsmangled bymix phoenix_kit.update. It now uses the same indentation-anchored pattern and derives the inserted entry’s indentation from the block instead of hardcoding four spaces.mix phoenix_kit.doctor‘s Oban check no longer raises onqueues: false/plugins: false— Oban’s documented way to disable either, standard in test config and on hosts that run jobs from a dedicated node.length(false)raisedArgumentError, surfacing as a bogusFAIL Exception: ....
PhoenixKit 1.7.212. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.