Cache update task cancellation and pre-queue validation
Current Behavior
- There exist de-duplication mechanisms in the queue itself to protect duplicate tasks from appearing in the queue
- However, once the cache update task starts and has left the queue, there is no mechanism to prevent another update task from entering the queue.
Proposal
-
When a cache update is triggered, the request will be validated before it enters the queue
-
If a cache update is already in progress, then the update request will be ignored, and it will not enter the queue.
- For single cache update request, Response will indicate cache update is already in progress.
- For multiple cache update request, Response will indicate which cache updates have been queued, and which cache updates have been ignored as updates are already in progress.
-
If a cache update is not already in progress, then the request will be processed as a task into the queue as normal
-
Need task cancellation method to be triggered by executor (already implemented)
-
Need task cancellation logic to allow process to be terminated (already implemented)
-
Need task cancellation watcher to clean up processes during transformer reset operation (in progress)
Acceptance Criteria
- Ability to immediately cancel update operations
- Implement cancel-watcher
- Implement pre-queue validation for cache update requests
- Implement pre-queue validation responses for cache update requests
Edited by Levi Remington