Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zlm2012
Copy link
Contributor

@zlm2012 zlm2012 commented May 1, 2018

Leased socket counting for targets becomes wrong when pooled sockets are reused or connection is cancelled, which would cause least connection load balancer not quite right. This PR fix those places.

@kazuho
Copy link
Member

kazuho commented May 11, 2018

@i110 Please review and merge if it looks good to you.

@i110
Copy link
Contributor

i110 commented May 17, 2018

Sorry for being late. The fix itself looks good for me, OTOH I don't understand why https://github.com/zlm2012/h2o/blob/9c0eaf065c633c69d4e23dd992807a93252a4594/lib/common/socketpool.c#L306 counts up only when target.size > 1? I guess that if we have only one target in a socketpool, socket counting will fail because it never gets incremented but decremented when we return a socket to that socketpool, am I right?

@zlm2012
Copy link
Contributor Author

zlm2012 commented May 17, 2018

Well it just because there's no reason to use a balancer if there's only one backend. But of course that would cause socket counting strange, so I will handle it.

@zlm2012
Copy link
Contributor Author

zlm2012 commented Jun 3, 2018

Sorry for the belated update. The lease counting should be correct now.

@i110
Copy link
Contributor

i110 commented Jun 4, 2018

LGTM!

@i110 i110 merged commit d84cd56 into h2o:master Jun 4, 2018
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