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

IdSortable should throw an exception it exhausts its seq bitspace #16

Open
CMCDragonkai opened this issue Sep 2, 2022 · 1 comment
Open
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity

Comments

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Sep 2, 2022

Specification

If the seq bitspace gets exhausted either within the 1 millisecond interval, or waiting for the OS clock to catch up to the last ID, the IdSortable should throw an exception. Any further generated IDs would no longer be valid, and therefore would violate the monotonic constraint of IdSortable.

Additional Context

Tasks

  1. Check if the seq bitspace is exhausted when generating an id
  2. Throw an exception like ErrorIdSortableSequenceRollover or ErrorIdSortableCounterExhausted...
  3. Tests for if one generates too many ids while mocking a static time.
  4. Tests for if the last ID is too far in the past.
@CMCDragonkai CMCDragonkai added the development Standard development label Sep 2, 2022
@CMCDragonkai
Copy link
Member Author

I think right now it just rolls over. You'd need to generate over 4K IDs within 1ms for this to be a problem.

@CMCDragonkai CMCDragonkai self-assigned this Jul 10, 2023
@CMCDragonkai CMCDragonkai added the r&d:polykey:supporting activity Supporting core activity label Jul 10, 2023
@CMCDragonkai CMCDragonkai removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity
Development

No branches or pull requests

1 participant