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

v4: Use a thread specific trunk for LDAP bind auths #4974

Closed
wants to merge 9 commits into from

Conversation

ndptech
Copy link
Member

@ndptech ndptech commented Apr 19, 2023

Since only one bind can be in progress at a time on a given connect, use of a trunk allows the number of connections in use to scale with load.

@@ -3167,7 +3167,7 @@ static void trunk_connection_enter_active(fr_trunk_connection_t *tconn)
/*
* Rebalance requests
*/
trunk_rebalance(trunk);
if (!trunk->conf.block_rebalance) trunk_rebalance(trunk);
Copy link
Member

@arr2036 arr2036 Apr 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not enough.. if the connection closed then the request would still get moved to another connection. It's probably be easier to remove the rebalance and to rework the code so that balancing was done in fr_trunk_connection_pop_request instead. The difficulty is how to actually do that balancing. I guess we could just allow as many requests to be popped as the max active request limit for the connection? I think it's 255 for RADIUS because we reserve one... one request per connection for "WAIT"ing redis... and I suppose as many requests it takes to fill the write buffer for LDAP. There the muxer would be self-limiting and stop popping requests once the write buffer was filled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further testing has shown that per_connection_max is doing what is needed, so this change is not required. Not sure why it didn't work first time through - probably something to do with the timing of marking the trunk requests as complete - that did change a number of times to get all the relevant structure lifetimes correct.

Otherwise in RDEBUG logging it is not clear which trunk the log relates
to.
The request being requeued is part of the list of requests causing the
connection to be marked as full - so it should be allowed to requeue.
The same structures are used for admin binds and user binds, but some
elements are only used in admin binds.
And associated function to allocate / retrieve the trunk
@ndptech ndptech closed this May 4, 2023
@ndptech ndptech deleted the v4_ldap_async3 branch May 4, 2023 14:51
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.

None yet

2 participants