Skip to content

fix: give each worker process a unique locker identity - #3628

Open
pplulee wants to merge 1 commit into
postalserver:mainfrom
pplulee:fix/unique-worker-locker-identity
Open

fix: give each worker process a unique locker identity#3628
pplulee wants to merge 1 commit into
postalserver:mainfrom
pplulee:fix/unique-worker-locker-identity

Conversation

@pplulee

@pplulee pplulee commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • Postal.locker_name was host:<hostname> pid:<pid> thread:<id>. Docker workers often share hostname and PID, so every process renewed the same worker_roles row and ran scheduled tasks concurrently.
  • Add a per-process random id to process_name so each worker has a distinct locker identity.

Fixes #3627

Test plan

  • Run two or more worker containers with the same hostname.
  • Confirm worker_roles.worker contains different id: values after restart.
  • Confirm only one worker logs running task / checking DNS for CheckAllDNSScheduledTask at :15.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorkerRole lock is shared when containers have the same hostname and PID

2 participants