Skip to content

Use ACPu storage for monotonic counters#112

Open
lroman242 wants to merge 3 commits intooittaa:masterfrom
lroman242:feature/php-fpm-acpu-storage-for-monotonic-counters
Open

Use ACPu storage for monotonic counters#112
lroman242 wants to merge 3 commits intooittaa:masterfrom
lroman242:feature/php-fpm-acpu-storage-for-monotonic-counters

Conversation

@lroman242
Copy link
Copy Markdown

This Pull Request addresses the issue of monotonic counters in multi-process environments (such as PHP-FPM):

  • Moved timestamp state management from class static properties to APCu shared memory.
  • Updated getUnixTimeSubsec() and getUnixTimeMs() to use apcu_fetch and apcu_store.
  • This ensures that UUID versions 6, 7, and 8 maintain strict monotonicity across different PHP-FPM worker processes, preventing potential collisions or out-of-order sequences during high concurrency.
  • Removed obsolete static properties: $unixts, $subsec, and $unixts_ms.

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.

1 participant