Skip to content

Conversation

@ino-josh
Copy link
Contributor

Fixes #1046. Perhaps the intent is clear now @gittiver?

Before this commit, the load balancing does not work. The foundation is there, but in practice, the next connection is always picked. For example, if there are 3 contexts available, it will always go: 0, 1, 2, 0, 1, 2, 0, 1, 2, etc. If 0 is a long running connection, and 1 and 2 are short, it will pick 0 for the next connection and then block waiting for that long running connection to end even though 1 and 2 are free. With this fix, the above example would result in this sequence: 0, 1, 2, 1, 2, 1, 2, 1, 2 (until 0 is done with its long running connection).

Before this commit, the load balancing does not work.
The foundation is there, but in practice, the next connection is always picked.
For example, if there are 3 contexts available, it will always go: 0, 1, 2, 0, 1, 2, 0, 1, 2, etc.
If 0 is a long running connection, and 1 and 2 are short, it will pick 0 for the next connection and then block waiting for that long running connection to end even though 1 and 2 are free.
With this fix, the above example would result in this sequence: 0, 1, 2, 1, 2, 1, 2, 1, 2 (until 0 is done with its long running connection).
@gittiver
Copy link
Member

Yes, sounds reasonable for me. :)

@gittiver gittiver merged commit aef1471 into CrowCpp:master Jun 11, 2025
13 checks passed
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.

"Loading balancing" doesn't actually work

2 participants