Repository navigation
fix(windows): write back edits after a blocked Cloud Files commit - #517
veryCrunchy merged 12 commits into
Conversation
When another application held a placeholder open, the exclusive in-sync commit failed after the upload had recorded the new revision. The identity then carried the uploaded size while Windows kept reporting the size from the last in-sync point, so every later close callback failed the size check and no further edit was written back while the app ran. The close callback no longer requires the recorded size to match the identity; hydration still does. The blocking application's own close now completes the pending commit without uploading again. A writeback also remembers the revision each accepted upload was based on, so a failed revision update is retried on its own instead of uploading again against the superseded revision.
A connected file placeholder is a cloud reparse point that Java NIO does not report as a regular file, so allocatedBytes and dehydrate returned 0 for every hydrated placeholder. Free up space, automatic cleanup, and the storage summary therefore found nothing to free. Classify the path from native find data with the startup enumeration rule and dehydrate only an unpinned, in-sync file placeholder. Windows refusals for content that became dirty, pinned, or open elsewhere free nothing instead of failing the whole pass, and freed totals count the bytes each dehydration released. Dehydration opens the file for attribute access only, so a reader that denies write sharing is reported as in use rather than as a sharing violation. Native tests on a disposable sync root hydrate, free, and reopen a file, and keep dirty, pinned, and externally open files local.
Obiente previewNC Native · Obiente updates this comment as the preview changes. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…k-commit' into fix/windows-cloud-files-dehydrate-classification
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c75ff6455d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A Windows CI runner reported no allocated bytes for a placeholder right after its content was read, although the same sample was complete locally. Wait within a bound until the file reports its whole size as allocated, and report the raw allocation result and placeholder state on timeout. Shorten the changelog summary to the fragment limit.
…es-writeback-commit
CfDehydratePlaceholder requires an exclusive handle, so dehydration now holds an exclusive CfOpenFileWithOplock handle. An oplock that cannot be taken or breaks first keeps the content local and frees nothing. An online-only placeholder allocates no bytes and is skipped before any native call, so a cleanup pass does not scale with the remote tree. Automatic cleanup executes its plan through one checker that also keeps a file whose known revision changed after planning, besides the existing pin, sync state, and allocated size checks.
Both writeback call sites read and validated the placeholder's current identity themselves. The writeback now does that once, which keeps the oversized provider below its recorded size baseline.
…k-commit' into fix/windows-cloud-files-dehydrate-classification # Conflicts: # tools/kotlin-file-size-baseline.txt
…e-classification fix(windows): dehydrate and measure connected Cloud Files placeholders
df655ee
into
feat/vigilant-bouman-5f3fc2
Stacked on #515, whose branch now includes #516. This commit was pushed after #516 merged, so it wasn't part of #516.
Outcome
On Windows Cloud Files, edits keep being written back after another application had the file open during an earlier upload. That file is marked as synced once the application closes it.
Root cause (reproduced on a disposable local Windows 11 sync root)
The scenario: another process holds a shared handle on the file during writeback.
Change
Validation
:ui:desktopTest --tests '*WindowsCloud*': 141 tests, 0 failures, 2 skipped (they need the packaged launcher). Run with JDK 21 on Windows 11.powershellprocess holds the file open during writeback, so the commit is blockedbash tools/check-kotlin-architecture.shpasses. Resolving the writeback identity moved intoWindowsCloudFilesWriteback, which lowers theWindowsCloudFilesProvider.ktbaseline from 2338 to 2331.Limits
Pending commits and revision updates are held in memory. After a restart, a placeholder whose new revision was never recorded is uploaded against its old revision, and the server rejects that upload. This is documented in
docs/windows-release.md.