This PR moves the code in method RunRouter.descriptor() that records descriptor uuids in RunRouter._start_to_descriptors and RunRouter._descriptor_to_start so it will execute before
subfactory callbacks are executed. The intention is to guarantee the dictionaries will be updated even if
a callback raises an exception.
Motivation and Context
Currently if a callback executed by RunRouter.descriptor() raises an exception these
dictionaries will not be updated with the descriptor uuid. Subsequent calls to RunRouter.event()
with event documents referencing the same descriptor will then fail because the descriptor uuid
will not be found in RunRouter._descriptor_to_start.
Closes #209.
How Has This Been Tested?
The test function test_subfactory_callback_exception has been added to test_run_router.py.
Description
This PR moves the code in method
RunRouter.descriptor()
that records descriptor uuids inRunRouter._start_to_descriptors
andRunRouter._descriptor_to_start
so it will execute before subfactory callbacks are executed. The intention is to guarantee the dictionaries will be updated even if a callback raises an exception.Motivation and Context
Currently if a callback executed by
RunRouter.descriptor()
raises an exception these dictionaries will not be updated with the descriptor uuid. Subsequent calls toRunRouter.event()
with event documents referencing the same descriptor will then fail because the descriptor uuid will not be found inRunRouter._descriptor_to_start
.Closes #209.
How Has This Been Tested?
The test function
test_subfactory_callback_exception
has been added totest_run_router.py
.