Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

UUID sequencing race in a message.Publisher #259

Closed
jgraettinger opened this issue May 25, 2020 · 0 comments
Closed

UUID sequencing race in a message.Publisher #259

jgraettinger opened this issue May 25, 2020 · 0 comments
Assignees
Labels

Comments

@jgraettinger
Copy link
Contributor

There's a possible race where concurrent calls A & B to PublishCommitted can interleave over the same journal:

  • A: SetUUID
  • B: SetUUID
  • B: StartAppend, Marshal
  • A: StartAppend, Marshal

This is a problem because A is written to the journal after B, but is sequenced as "before" B. message.Sequencer will later discard A, thinking it a duplicate. This impacts services using a single Publisher.PublishCommitted with high concurrency (as is common for HTTP APIs writing event logs). This isn't an issue for PublishUncommitted, as that's already marked unsafe for concurrent use.

Thanks to @michaelschiff for reporting.

@jgraettinger jgraettinger self-assigned this May 25, 2020
jgraettinger added a commit to jgraettinger/gazette that referenced this issue May 25, 2020
Update stream-sum example and test to reproduce the motivating bug (and catch any
regressions), by introducing parallel workers using a shared Publisher.

Fixes gazette#259
jgraettinger added a commit to jgraettinger/gazette that referenced this issue May 25, 2020
Update stream-sum example and test to reproduce the motivating bug (and catch any
regressions), by introducing parallel workers using a shared Publisher.

Fixes gazette#259
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant