Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enforce sequential processing of session events #4493

Merged
merged 9 commits into from
Sep 3, 2024

Conversation

zoldar
Copy link
Contributor

@zoldar zoldar commented Aug 30, 2024

Changes

This PR enforces sequential processing of events for the same session. Currently, when two events for the same session are processed concurrently, it's possible that session lookup will either turn up empty (initial event) or return the same previous session state for two concurrently processed events. This in turn can result in inconsistent session entries (like, for instance, two session entries for the same session_id). More detailed example race scenario this fix addresses is described at https://github.com/plausible/analytics/pull/4493/files#diff-16bb729e90786448aef27f15fce06e9d977d947389e91fdc24c0ea6760c290f6R78-R99.

TODO

Tests

  • Automated tests have been added

@zoldar zoldar force-pushed the fix/event-processing-queue branch from d6caeac to 58cd586 Compare August 30, 2024 09:18
NOTE: Apparent double execution of lock function needs to be investigated.
@zoldar zoldar force-pushed the fix/event-processing-queue branch from 4684eb9 to d8b96df Compare August 31, 2024 09:42
@zoldar zoldar requested a review from a team September 2, 2024 13:49
@zoldar zoldar marked this pull request as ready for review September 2, 2024 13:49
@zoldar zoldar merged commit 8a1c6e0 into master Sep 3, 2024
10 checks passed
@aerosol aerosol deleted the fix/event-processing-queue branch September 3, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants