Skip to content

Suggestion: Should preserve_finished_jobs really default to true? #560

Open
@stefanvermaas

Description

@stefanvermaas

We've just hit a tricky issue that I think many teams might run into, especially when adopting solid_queue in smaller projects without deep background job needs.

By default, SolidQueue preserves all finished jobs (source). That feels like a safe option at first glance, but if you're not aware of this setting, you might only discover it once it's too late.

In our case, we had a small Rails app using SolidQueue out of the box. It was deployed with Kamal, everything worked perfectly for months. Until one day, the app became unreachable. No traffic, no response, and only a single error message from hours earlier: "could not connect to database."

The database server was up. The app server was up. But after digging in, we discovered that the entire server had run out of disk space.

The root cause? All those finished background jobs were quietly preserved. Since this app had processed hundreds of thousands of jobs over time, including all error notifications, which also went through the job system, things spiraled. Once the disk was full, new jobs couldn't run, including error reporting. We were blind to the failure.

To make matters worse, recovering the machine wasn't easy. With no space left, even SSH access became unreliable. Freeing up disk space in that state is non-trivial, especially if you don't have automated clean-up in place.

Yes, we should have monitored disk usage more closely. But we did clean up our own records — we just didn’t realize that finished jobs were being preserved automatically.
Proposal

Should SolidQueue.preserve_finished_jobs really default to true?

Most job libraries don’t retain finished jobs unless you explicitly ask for that. For example, Sidekiq and Resque both discard successful jobs by default. It’s easy to opt into persistence if you need auditing or observability, but it's safer to start with a clean slate.

For a lot of teams, especially those adopting SolidQueue for the first time, this default might feel invisible until it causes problems. Would it be worth reconsidering?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions