Repository navigation
fix: prevent deadlock when deleting a datastore - #551
Merged
Merged
Conversation
alexandernorth
force-pushed
the
fix-datastore-delete-deadlock
branch
from
November 16, 2026 14:52
42f9b29 to
3941fd3
Compare
Signed-off-by: Alexander North <alexandernorth@users.noreply.github.com>
Signed-off-by: Alexander North <alexandernorth@users.noreply.github.com>
Signed-off-by: Alexander North <alexandernorth@users.noreply.github.com>
alexandernorth
force-pushed
the
fix-datastore-delete-deadlock
branch
from
November 16, 2026 14:56
3941fd3 to
a180ac3
Compare
… streams - Release DatastoreMap lock during Stop/Delete I/O using per-name pending serialization so slow deletes do not block unrelated datastores, while restoring the entry on delete failure. - Guard Datastore.sbi with sbiMutex and close late-connecting SBI targets if Stop already cancelled the datastore. - Guard LocalCache.InstanceIntentGetAll error delivery against unbuffered errChan callers and cancel the store stream before waiting on errChan. - Simplify LoadAllButRunningIntents to range over intentChan and read errChan afterwards. - Add unit tests for unbuffered/unmarshal stream cases, LoadAllButRunningIntents cancellation, and concurrent datastore delete/recreate/retry. Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Collaborator
|
Pushed a small follow-up commit (
|
steiler
approved these changes
Nov 17, 2026
Combine scrapligo Close timeout from main with closeOnce idempotency from this branch. Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
faebr
approved these changes
Nov 17, 2026
alexandernorth
commented
Nov 17, 2026
Collaborator
Why
|
Resolve go.mod conflict: scrapligo v1.4.4 from main, cache v0.0.39 from branch. Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
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.
Deleting a datastore could hang forever and wedge the whole server (
DeadlineExceededon every retry). An abandonedIntentGetAllstream left the filesystem store locked, soInstanceDeleteblocked while holding the datastore map and cache locks.sdcio/cacheto include fix: avoid cache-wide deadlock when an IntentGetAll consumer stops reading cache#173 and simplifyLocalCache.InstanceIntentGetAll(also no longer drops the stream error).LoadAllButRunningIntentsreturns early so the store is released.GetDataStorein intent/transaction RPCs andStopAll(unsynchronized map access).DeleteDatastorereturns cache delete errors and keeps the entry so retries can clean up; not-found counts as deleted.initCacherespects ctx and accepts already-exists; startup no longer adds a nil datastore on failure.Closeis idempotent (scrapligo blocks forever on a secondClose).Note:
sdcio/cacheis pinned to a pseudo-version; bump to the release tag once cut.