mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? Added a new priority semaphore implementation to common/locks package. Using this priority semaphore in shard context for controlling persistence IO requests. All requests except delete workflow execution that is triggered by retention timers use HighPriority for locking. DeleteWorkflowExecution() called by retention timer will use LowPriority for acquiring this semaphore. ## Why? We had seen a problem when large number of retention timers fire for different runs of a particular workflow id. These timers will make this shard hot and other requests to this shard gets delayed at the semaphore. By introducing priority and setting low priority for the operation from retention timer, we could avoid this problem. It is okay for retention timers to get low priority treatment because it is not time critical. ## How did you test it? Unit test for priority semaphore. ## Potential risks None ## Documentation ## Is hotfix candidate? No