Skip to content

cache_sweeper doesn't work with puma cluster mode #228

Open
@davekaro

Description

If you run Puma in cluster mode in development, you can end up getting a 404 when requesting a new asset (similar issue to #183). I tracked it down to the digest being memoized (introduced in #23). I can't quite reason about why it happens, but the issue is the fresh? check in server will use the old (memoized) digest depending on what puma worker your request hits.

Replication steps I used was to start rails with WEB_CONCURRENCY=2, load a page in the browser, update a javascript file, then refresh the page. The new request will have an updated javascript digest in the script tag, but depending on what puma worker you hit, that memoized digest will be the old one, so the server returns 404.

I removed the memoization of the digest and that fixed the problem, but that may not be desirable.

Maybe the answer is don't run puma in cluster mode in dev, which would be fine for me.

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