Skip to content

fix: prevent duplicate uploads by skipping release when an upload is already in progress#347

Merged
egalvis27 merged 1 commit into
feat/go-fuse-daemonfrom
fix/avoid-run-two-releases
May 26, 2026
Merged

fix: prevent duplicate uploads by skipping release when an upload is already in progress#347
egalvis27 merged 1 commit into
feat/go-fuse-daemonfrom
fix/avoid-run-two-releases

Conversation

@egalvis27
Copy link
Copy Markdown

What is Changed / Added

When a file is written through the virtual drive, the FUSE daemon creates one
InternxtFile handle per Open() / Create() call. Release() is triggered
once per handle — not once per file — so opening the same path twice (e.g. one
descriptor for the write and a second one opened by GNOME's pool-org.gnome.*
worker to read metadata) results in two independent POST /op/release requests
for the same path.

Both releases found the temporal file, found no existing remote file yet, and
raced to upload and then register the file metadata. The first one succeeded;
the second hit a 409 File already exists from the Drive server, which was then
propagated as an unhandled error and logged twice.

@sonarqubecloud
Copy link
Copy Markdown

Comment on lines +146 to +147
resolveFirstUpload();
await first;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this on the test?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is intended to clear the set that stores uploads in progress, so they don't remain there and interfere with other tests.

@egalvis27 egalvis27 merged commit fa9df0a into feat/go-fuse-daemon May 26, 2026
10 of 11 checks passed
@egalvis27 egalvis27 deleted the fix/avoid-run-two-releases branch May 26, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants