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

Run sync context managers in a single thread #5114

Closed
wants to merge 7 commits into from

Conversation

adriangb
Copy link
Contributor

@adriangb adriangb commented Jul 8, 2022

This avoids a deadlock where __exit__ can't be called because there are no thread tokens available. Partially resolves #3205 and other related issues.

@adriangb
Copy link
Contributor Author

adriangb commented Jul 8, 2022

cc @graingert @Kludex

@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #5114 (d6202f5) into master (8047230) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #5114   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          532       533    +1     
  Lines        13672     13716   +44     
=========================================
+ Hits         13672     13716   +44     
Impacted Files Coverage Δ
fastapi/concurrency.py 100.00% <100.00%> (ø)
tests/test_concurrency.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8047230...d6202f5. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

📝 Docs preview for commit 732c0e9 at: https://62c8571bf399773d59da1a9b--fastapi.netlify.app

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

📝 Docs preview for commit c2d73cd at: https://62c8582b4d7df6396e3dd6a6--fastapi.netlify.app

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

📝 Docs preview for commit e39c97c at: https://62c866fbf77cbd4b372cd172--fastapi.netlify.app

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

📝 Docs preview for commit d6202f5 at: https://62c8680e69e7074ec8565f20--fastapi.netlify.app

@adriangb
Copy link
Contributor Author

Closing in favor of #5122

@adriangb adriangb closed this Jul 11, 2022
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.

Using dependency injection to get SQLAlchemy session can lead to deadlock
2 participants