Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Change after_fork suggestion to before_fork #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Change after_fork suggestion to before_fork #47

wants to merge 2 commits into from

Conversation

aripollak
Copy link

Changing it in the worker process won't have the desired effect since then all the workers all get the same incremented sequence number. before_fork runs in the master process before the fork, so the new sequence number gets inherited in each worker.

@aripollak
Copy link
Author

Any comment on this? We've had a couple of UUID collisions out of 18 million rows, which I believe is caused by this bug since the duplicated UUIDs were generated at the same time.

@aripollak
Copy link
Author

Also, for Puma, before_fork only runs once before any workers are forked, so that should use a on_worker_fork block (confusingly) instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant