drivers: tolerate a concurrently deleted task on ttl - #267
Open
maksimuimin wants to merge 1 commit into
Open
maksimuimin wants to merge 1 commit into
maksimuimin wants to merge 1 commit into
Conversation
The ttl branch of the fiber iteration in fifottl and utubettl (and the expired-task path of utubettl take() in the ready buffer mode) called :transform() on the result of delete(), which is nil when the task has been deleted concurrently between min() and delete(). With vinyl (yielding reads) or MVCC this killed the ttl fiber. The delayed and ttr branches already tolerate a nil from update(). delete() already returns the task with the DONE status, so the extra transform is dropped as well. Closes tarantool#264 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #264
Independent of #265 and #266 (based on master).
Problem
The ttl branch of the fiber iteration in
fifottlandutubettl, and the expired-task path ofutubettltake()in the ready buffer mode, diddelete()returnsnilwhen the task is already gone, so a task deleted concurrently betweenmin()anddelete()raisedattempt to index a nil valueand killed the ttl fiber. Reachable with vinyl (yielding reads) or MVCC; the delayed and ttr branches already tolerate anilfromupdate().Fix
Check the result of
delete()before reporting thettlevent.delete()already returns the task with theDONEstatus, so the extratransform()is dropped.New test
t/280-ttl-delete-nil.temulates the concurrent delete through the driver'sdelete()and checks that the fiber survives and keeps processing. The test fails on master. Full suite passes locally (Tarantool 3.8, memtx and vinyl).