-
Notifications
You must be signed in to change notification settings - Fork 56
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: Creating batches with more than one class breaks on v4 #1005
Comments
Hi @glesperance, thanks for raising this one! We did not intend for collection-level batching to be ran simultaneously. What you're seeing is the underlying multi-threaded algorithms colliding since each collection-level batch handles its own separate resources internally.
This is not true. To accomplish your use-case, you should use client-level batching instead like so: with client.batch.dynamic() as batch:
batch.add_object(
collection=a_collection.name,
properties={"a_name": "test"},
uuid=weaviate.util.generate_uuid5(i)
)
batch.add_object(
collection=b_collection.name,
properties={"b_name": "test"},
uuid=weaviate.util.generate_uuid5(i)
) as described here. Cheers 😁 |
I certainly missed that part of the documentation. Thanks for pointing this out. Do we want to leave this open for the nested collection batch edge case? |
Yes, I will look into throwing an exception if multiple batches run in a nested setup. Thanks for the report! |
The only way to insert objects with v4 is using
collection.batch
and its associated_ContextManagerWrapper
.Unfortunately, this breaks as the underlying
grpcio
runs into resource contention raising the exceptions listed below.The output is rather unpredictable as the exceptions are only printed out but not raised. The batches will also sometimes hang indefinitely, some other times work 100%, or as shown below sometimes work only partially.
With v3 it used to be possible to insert, in batches, objects from different classes. It would be great to continue supporting this use case.
Output:
The text was updated successfully, but these errors were encountered: