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

Instances are not used in actual round-robin #178

Closed
sosthene-nitrokey opened this issue Jan 18, 2024 · 1 comment
Closed

Instances are not used in actual round-robin #178

sosthene-nitrokey opened this issue Jan 18, 2024 · 1 comment

Comments

@sosthene-nitrokey
Copy link
Contributor

The round-robin is done from the index field of the Session type, but since the LoginCtx is often cloned, most request will bump index but then drop it, meaning that most operation do not bump a "global" index for each slot. Also each session has its own index, but the index should proably be stored per-slot.

Fixes:

  • Clone the LoginCtx much less, and instead pass a &mut LoginCtx everywhere. This wouldn't work everywhere though.

  • Store an atmoicusize in the Slot and keep a Arc to it in the LoginCtx instead, but then there are race conditions where multiple parallel requests to the same slot will "skip" an instance and retry some other instance twice. 

  • Keep the round-robin per-session, but rotate the starting instance of each session when the session is created.

@sosthene-nitrokey
Copy link
Contributor Author

Done by #218

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

No branches or pull requests

1 participant