Incorrect SearchContext
iteration with asyncio.TaskGroup
in back-end
#966
Labels
SearchContext
iteration with asyncio.TaskGroup
in back-end
#966
In back-end we perform multiple index based for loop and
getitem_async()
for an instance ofSearchContext
.With the Sumo
SearchContext
we want to get items in parallel. This is done bysc.length_async
and then iterating over the range. We then get the item usinggetitem_async
. The issue lies in the fact thatSeachContext
has its internalsc._hits
array, which is not initialized upfront with this code, thereby the parallel code calls multiple initializations ofsc._hits
when ran in parallel.TODO: Replace loop using
sc.uuids_async
and then loop over theuuids
and callsc.get_object_async
instead ofsc.getitem_async
.The text was updated successfully, but these errors were encountered: