Skip to content

Prioritize reads from queue by message ID #138

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

Merged
merged 7 commits into from
Oct 21, 2014

Conversation

mtodd
Copy link
Member

@mtodd mtodd commented Oct 19, 2014

This is an an alternative proposal (compared to #136) for the issues defined in #133. It aims for minimal changes to provide for correctness. The changes here are local to Net::LDAP::Connection#search but could be moved to Net::LDAP::Connection#read instead.

Thoughts?

NOTE: This is targeting the open-integration-tests branch since it was branched from there for testing/development.

cc @jch @schaary

@mtodd
Copy link
Member Author

mtodd commented Oct 19, 2014

Decided to extract the logic into Net::LDAP::Connection#queued_read(message_id) to make it easier to reason about.


result_pdu = nil
controls = []

while pdu = read
while pdu = queued_read(message_id)
Copy link
Member

Choose a reason for hiding this comment

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

I like how you've minimized changes to the existing search logic. It's a little strange that both this and queued_read both have a while loop, but I think this is a step in the right direction, and we can incrementally change this logic later on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, though the practical impact here is that we'll just read in a loop until we get a result for the requested message_id, but then when control switches to the other query, the queued messages will be quickly drained from the queue.

@jch
Copy link
Member

jch commented Oct 21, 2014

Does this fix the failing test you had for the open bug? It'd be nice to include that failing test in this PR as well.

@mtodd
Copy link
Member Author

mtodd commented Oct 21, 2014

@jch this was branched off of #129 so it should include those tests already! :)

@jch
Copy link
Member

jch commented Oct 21, 2014

🚢

mtodd added a commit that referenced this pull request Oct 21, 2014
Prioritize reads from queue by message ID
@mtodd mtodd merged commit bd4f3fd into open-integration-tests Oct 21, 2014
@mtodd mtodd deleted the read-queue-by-message_id branch October 21, 2014 17:25
astratto pushed a commit to astratto/ruby-net-ldap that referenced this pull request Dec 18, 2015
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.

2 participants