Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop unnecessary expire time check in ttl event handler
handleTTLEvents already calls loadTTLEventKV which gets the most recent event for the key while holding a lock. This is then checked to confirm expiration before calling deleteTTLEvent. Because it's checked before calling, we don't need to do a locked check of the store AGAIN in deleteTTLEvent. If another goroutine updated the key in the time between when loadTTLEventKV returned the event, and the time that deleteTTLEvent tries to delete it, the actual Delete will fail because the modRevision is no longer current, and the error path will ensure that the key is re-enqueued and processed at the correct time. Without this extra check there's not much logic left in deleteTTLEvent, and there are no other call sites, so just move it into handleTTLEvents. Signed-off-by: Brad Davidson <[email protected]>
- Loading branch information