You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MongoAdapter._build_event_stream(self, run_start_uid, stream_name, is_complete)
1466 # We need each of the sub-dicts to have a consistent length. If
1467 # Events are still being added, we need to choose a consistent
1468 # cutoff. If not, we need to know the length anyway. Note that this
1469 # is not the same thing as the number of Event documents in the
1470 # stream because seq_num may be repeated, nonunique.
1471 cursor = self._event_collection.aggregate(
1472 [
1473 {"$match": {"descriptor": {"$in": event_descriptor_uids}}},
(...)
1480 ]
1481 )
-> 1482 (result,) = cursor
1483 cutoff_seq_num = (
1484 1 + result["highest_seq_num"]
1485 ) # `1 +` because we use a half-open interval
1486 object_names = event_descriptors[0]["object_keys"]
ValueError: not enough values to unpack (expected 1, got 0)
Possible Solution
We need to deal with the possibility that the cursor that comes out of
may have 0 or 1 values in it (rather than always exactly 1 value).
There are a couple other such unpackings that may need to be fixed as well.
Steps to Reproduce (for bugs)
try create the header object for a run that contains an empty stream (have a descriptor, but no events)
Context
had to change from a comprehension to a for loop so I could put a try/except in, but in general this is fatal to any process that wants to look at the meta data of runs that may have failed or been cancelled mid-collection between the descriptor going out and the first event going out.
The ability to pre-declare streams being proposed in bluesky will make it much easier to end up in this situation.
Expected Behavior
Current Behavior
Possible Solution
We need to deal with the possibility that the cursor that comes out of
databroker/databroker/mongo_normalized.py
Lines 1471 to 1482 in c416450
There are a couple other such unpackings that may need to be fixed as well.
Steps to Reproduce (for bugs)
Context
had to change from a comprehension to a for loop so I could put a try/except in, but in general this is fatal to any process that wants to look at the meta data of runs that may have failed or been cancelled mid-collection between the descriptor going out and the first event going out.
The ability to pre-declare streams being proposed in bluesky will make it much easier to end up in this situation.
Your Environment
in the 2022-3.0-py39-tiled environment
The text was updated successfully, but these errors were encountered: