Replace racey mutexed map with skip coordinator#97
Merged
Conversation
Reviewer's GuideThe PR removes the race-prone mutex-based fileLocks in favor of a channel-driven skip coordinator to serialize duplicate hard-link operations, updates the link/snwaggle functions to use this new coordinator, and adjusts tests to validate the new skip behavior. Class diagram for skip coordinator and related typesclassDiagram
class skipCheck {
+hardLink hardLink
+chan bool response
}
class hardLink {
+string source
+string resolved
+string destination
}
class skipHandler {
}
skipHandler --|> skipCheck
skipCheck o-- hardLink
Flow diagram for skipHandler logicflowchart TD
A["Receive skipCheck request"] --> B{"destination already linked?"}
B -- No --> C["Mark destination as linked"]
C --> D["Respond: false (do not skip)"]
B -- Yes --> E["Respond: true (skip)"]
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
- Coverage 74.67% 74.42% -0.25%
==========================================
Files 12 12
Lines 687 696 +9
==========================================
+ Hits 513 518 +5
- Misses 120 122 +2
- Partials 54 56 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
Author
|
@sourcery-ai summary |
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 #96
Summary by Sourcery
Replace mutex-based file locking with a channel-driven skip coordinator to dedupe duplicate link operations and update related logic
Enhancements:
Tests: