-
Change Request
-
Resolution: Fixed
-
Trivial
-
None
-
None
-
Sprint 41
-
1
During history cache synchrinization server locks configuration cache within history cache lock. The processing is like:
- lock history cache
- get items from history cache
- lock triggers for retrieved items (configuration cache lock/unlock)
- put items with failed trigger locks back into history cache
- unlock history cache
- process values for items with successfully locked triggers
- unlock triggers for processed items (configuration cache lock/unlock)
- lock history cache
- put processed items back in history cache
- unlock history cache
It's possible to get rid of lock nesting by moving trigger locking outside history cache lock, somthing like:
- lock history cache
- get items from history cache
- unlock history cache
- lock triggers for retrieved items (configuration cache lock/unlock)
- process values for items with successfully locked triggers
- unlock triggers for processed items (configuration cache lock/unlock)
- lock history cache
- put items with locked triggers back in history cache
- put processed items back in history cache
- unlock history cache
Testing showed ~21% throughput (values per second) increase in data processing. The test patch is attached however it can be improved (hc_push_busy_items and hc_push_processed_items could be merged in one function).