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

thread utils respect contextvars #4074

Merged
merged 4 commits into from
Feb 24, 2025
Merged

Conversation

evan-danswer
Copy link
Contributor

@evan-danswer evan-danswer commented Feb 20, 2025

Description

https://linear.app/danswer/issue/DAN-1471/parallelism-should-respect-contextvars

Our utils for running functions with thread-level parallelism didn't pass contextvars through, i.e. tenant id. Now they do! Should be safe to use with i.e. acquiring a db session, although in most cases there isn't a need to acquire sessions in parallel.

How Has This Been Tested?

New unit tests; they fail without the code changes

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 0:04am

@evan-danswer evan-danswer added this pull request to the merge queue Feb 24, 2025
Merged via the queue into main with commit 4a4e4a6 Feb 24, 2025
10 checks passed
@evan-danswer evan-danswer deleted the thread-parallel-contextvar branch February 24, 2025 18:16
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