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

[BUG] Fix NAC getting stuck #2991

Merged
merged 3 commits into from
Oct 31, 2024
Merged

[BUG] Fix NAC getting stuck #2991

merged 3 commits into from
Oct 31, 2024

Conversation

sanketkedia
Copy link
Contributor

@sanketkedia sanketkedia commented Oct 23, 2024

Description of changes

Summarize the changes made by this PR.

  • NAC would just get stuck if all tokens are exhausted by a single request in a low concurrency setting. There is a bug in the code that defers the release of all tokens for a request to the very end, this PR fixes that. Verified through a local repro.

Test plan

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

None

Copy link

Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sanketkedia and the rest of your teammates on Graphite Graphite

@sanketkedia sanketkedia changed the title Fix NAC bug [BUG] Fix NAC getting stuck Oct 23, 2024
@sanketkedia sanketkedia marked this pull request as ready for review October 23, 2024 00:56
@@ -444,5 +450,7 @@ mod tests {
test_multipart_get_for_size(1024 * 1024 * 7).await;
// At > 8 MB.
test_multipart_get_for_size(1024 * 1024 * 19).await;
// Greater than NAC limit i.e. > 5*8 MB = 40 MB.
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like 100MB

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think he's saying the NAC limit is 5*8, so this will be greater than that and trigger the bug we found? But I am not sure where 5 comes from

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sanketkedia sanketkedia merged commit 5c6a804 into main Oct 31, 2024
72 checks passed
codetheweb pushed a commit that referenced this pull request Nov 5, 2024
## Description of changes

*Summarize the changes made by this PR.*
- NAC would just get stuck if all tokens are exhausted by a single
request in a low concurrency setting. There is a bug in the code that
defers the release of all tokens for a request to the very end, this PR
fixes that. Verified through a local repro.
## Test plan
- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
None
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