How does set_user work with concurrency with FastAPI #1762
Unanswered
Exagone313
asked this question in
Q&A
Replies: 1 comment
-
I tested this locally and it appears to work as expected—the user is reset with each new request. However, I'm not confident this guarantees the same behavior in a production environment. A clarification on this would be helpful! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is
set_user
concurrency-safe? FastAPI uses an event loop and (if I understand correctly) the processing of a response can be stopped and resumed while another route is handled in the middle. This means that, when the first route processing is resumed, the currently set user may not be the one set previously.Or, does sentry-sdk deal with this and saves the user per-request somehow?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions