Skip to content

one file permission does not cause failure - #1097

Merged
rsenden merged 3 commits into
dev/v3.xfrom
p/umadevis1/permission_fix
Sep 18, 2026
Merged

rsenden merged 3 commits into
dev/v3.xfrom
p/umadevis1/permission_fix

Conversation

@umadevis1

Copy link
Copy Markdown
Contributor

FileWriteCoordinator.java: commitRemediationWrites now only records a rollback entry for a file after its write succeeds, instead of before attempting it. A file whose write itself fails is already in its original state and needs no rollback — so the rollback path no longer retries writing to the same permission-denied file, which is what previously escalated into a batch-aborting RollbackRemediationException. That specific remediation is now skipped (SOURCE_WRITE_FAILED) and every other remediation — for other files, other issues — proceeds normally. The whole batch no longer aborts.
RemediationProcessorTest.java: added a regression test (readOnlyFileWriteFailureIsSkippedAndOtherRemediationsStillApply) that makes one file read-only, runs two remediations (one targeting it, one targeting a normal file), and asserts the read-only one is skipped on its own while the other still applies.

Note: if a multi-file remediation successfully writes file A and then fails writing file B (permission denied), it still needs to roll back A's already-written change. If that rollback of A also fails (e.g., A independently became read-only too), we will still hit the batch-aborting RollbackRemediationException — because at that point a file has genuinely been left modified and the code can't safely undo it, so halting is arguably still the right call rather than silently continuing over an inconsistent source tree.

@ankit2995
ankit2995 self-requested a review September 18, 2026 06:48
@rsenden
rsenden merged commit 270a143 into dev/v3.x Sep 18, 2026
22 of 30 checks passed
@rsenden
rsenden deleted the p/umadevis1/permission_fix branch September 18, 2026 08:57
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.

4 participants