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

Fix deadlocks and races in multi-threaded asyncio logic #747

Merged
merged 13 commits into from
Jan 18, 2024

Conversation

tsmith023
Copy link
Contributor

@tsmith023 tsmith023 commented Jan 17, 2024

This PR fixes a host of multi-threading event loop problems by simplifying the logic around creating new event loops and spawning them in threads. Now, the batching code handles its own internal event loop outside of any main thread loop and does so entirely within the context of the background batching thread

@tsmith023 tsmith023 requested a review from dirkkul January 17, 2024 15:01
@codecov-commenter
Copy link

Codecov Report

Attention: 259 lines in your changes are missing coverage. Please review.

Comparison is base (a26557b) 89.38% compared to head (8bc470a) 89.18%.
Report is 228 commits behind head on beta/v4.0.

Files Patch % Lines
integration/test_collection_openai.py 33.33% 38 Missing ⚠️
weaviate/collections/batch/base.py 82.43% 26 Missing ⚠️
weaviate/collections/filters.py 73.01% 17 Missing ⚠️
weaviate/collections/data.py 78.57% 15 Missing ⚠️
integration/test_collection_rerank.py 26.31% 14 Missing ⚠️
weaviate/collections/batch/batch_wrapper.py 82.27% 14 Missing ⚠️
weaviate/collections/batch/grpc_batch_objects.py 84.41% 12 Missing ⚠️
weaviate/collections/config.py 66.66% 10 Missing ⚠️
weaviate/client.py 84.48% 9 Missing ⚠️
integration/test_collection_batch_delete.py 94.96% 8 Missing ⚠️
... and 32 more
Additional details and impacted files
@@              Coverage Diff              @@
##           beta/v4.0     #747      +/-   ##
=============================================
- Coverage      89.38%   89.18%   -0.20%     
=============================================
  Files            154      177      +23     
  Lines          16747    18029    +1282     
=============================================
+ Hits           14970    16080    +1110     
- Misses          1777     1949     +172     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@weaviate-git-bot
Copy link

Great to see you again! Thanks for the contribution.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

weaviate/connect/base.py Outdated Show resolved Hide resolved
weaviate/collections/batch/batch_wrapper.py Outdated Show resolved Hide resolved
weaviate/collections/batch/batch_wrapper.py Outdated Show resolved Hide resolved
weaviate/collections/batch/base.py Outdated Show resolved Hide resolved
weaviate/collections/batch/base.py Outdated Show resolved Hide resolved
weaviate/collections/batch/base.py Outdated Show resolved Hide resolved
weaviate/connect/base.py Outdated Show resolved Hide resolved
@tsmith023 tsmith023 changed the title swap in grpclib for async grpc requests Fix deadlocks and races in multi-threaded asyncio logic Jan 18, 2024
@tsmith023 tsmith023 merged commit dfc05cf into beta/v4.0 Jan 18, 2024
35 checks passed
@tsmith023 tsmith023 deleted the beta/use-grpclib-for-async branch January 18, 2024 12:57
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.

4 participants