equinor / webviz

Mozilla Public License 2.0
6 stars 6 forks source link

Timeout/IndexError when iterating over large(ish) Sumo Document collections #586

Closed HansKallekleiv closed 6 months ago

HansKallekleiv commented 6 months ago

Currently some of our Sumo queries iterating over large collections fails with an IndexError before all results are returned. We should use a Point-in-time(PIT) with a keep_alive parameter to create a stable view of the data for the duration of the query.

keep_alive="1m" (1 minute) should be sufficient for these types of query.

E.g.:

sumo_client: SumoClient = create_sumo_client_instance(access_token)
case_collection = CaseCollection(sumo_client, pit=Pit(sumo_client, keep_alive="1m")).filter(uuid=case_uuid)

or

sumo = Explorer(keep_alive="1m")
case_collection = sumo.cases.filter(uuid=case_uuid)