bug: caching descriptorHandles over internal mdib transactions may result in a KeyError e.g. for removed descriptors/states
Closed this issue · 0 comments
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
https://github.com/Draegerwerk/sdc11073/blob/c84ba85344ce0b4ca1671ac0c1f1ca77fc024363/src/sdc11073/roles/alarmprovider.py#L404C53-L404C53 i.e. _updateAlertSystemState_CurrentAlerts throws a KeyError when a descriptor is removed between getting all the states and trying to get them based on a handle
alertStatesNeedingUpdate has to be generated in a transaction or mdib lock
not sure in which way transaction and mdib locks are supposed to be synchronized, so this has to be clarified
also note that this error may occur in other cases as well where handles are cached or saved and used accross transactions for mdib access
Expected Behavior
no KeyError and proper synchronization
Minimal Reproducible Example
No response
Solution proposal
No response
Python Version
3.11.3
Operating system
"win32"
Sdc11073 Version
1.3.0
Link to sdc11073 Logs
No response
Further Information
may also affect major version 2 releases
Participation
- I am willing to submit a pull request to fix this bug.