Draft
Conversation
This is the FileObserver-based approach from the previously closed PR. Created as an alternative branch for comparison. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
df19652 to
4b68488
Compare
4b68488 to
9f7d1cb
Compare
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3168 +/- ##
===========================================
+ Coverage 70.96% 71.02% +0.06%
===========================================
Files 912 912
Lines 33548 33577 +29
Branches 5640 5648 +8
===========================================
+ Hits 23804 23845 +41
+ Misses 8173 8162 -11
+ Partials 1571 1570 -1
🚀 New features to boost your workflow:
|
| currentBatchState.set(CurrentBatchState(newFile, 1L, now)) | ||
| pendingFiles.incrementAndGet() | ||
| return newFile | ||
| synchronized(knownFiles) { |
Contributor
There was a problem hiding this comment.
Between currentBatchState.set() and knownFiles.add(), there's a brief window where:
currentBatchStatepoints to the new fileknownFilesdoesn't contain it yet
If listBatchFiles() is called during this window, it won't include the new file, causing getReusableWritableFile() to potentially return null when it shouldn't.
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.
What does this PR do?
This is the follow-up on #2720, which was rolled back in #3124.
The fixes can be found in this commit, which include:
existsSafecall insidegetReadableFile(), so that we don't return a stale file that no longer exists on disk.synchronizedand grouping the state intocurrentBatchState: AtomicReference<CurrentBatchState>.eventandFILE_OBSERVER_MASK, use bitmask logic to guarantee matches when some additional bits might have been set.Review checklist (to be filled by reviewers)