Skip to content

handle IOException in rename during CompactPersistentActionCache init - #30866

Open
dws wants to merge 1 commit into
bazelbuild:masterfrom
dws:rename-exception
Open

handle IOException in rename during CompactPersistentActionCache init#30866
dws wants to merge 1 commit into
bazelbuild:masterfrom
dws:rename-exception

Conversation

@dws

@dws dws commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

I've observed Bazel 9.2.0 failing as follows:

ERROR: Couldn't create action cache: [unix_jni.cc:638] /tmp/.cache-bzlmod/bazel/_bazel_jenkins/output-base/action_cache -> /tmp/.cache-bzlmod/bazel/_bazel_jenkins/output-base/action_cache.bad (Invalid cross-device link). If error persists, use 'bazel clean'.

This unhandled IOException causes Bazel to fail to print the original cause of the problem that drove it into logAndThrowOrRecurse().

We here attempt to improve the reporting and allow Bazel to survive the problem.

Note that renameCorruptedFiles() in Bazel 8 does handle and survive IOException.

Motivation

Since Bazel 8 was able to survive not being able to rename corrupted action cache files,
it seems like it would be a good idea for Bazel 9 to be able to do the same.

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

I've observed Bazel 9 failing as follows:

    ERROR: Couldn't create action cache: [unix_jni.cc:638] /tmp/.cache-bzlmod/bazel/_bazel_jenkins/output-base/action_cache -> /tmp/.cache-bzlmod/bazel/_bazel_jenkins/output-base/action_cache.bad (Invalid cross-device link). If error persists, use 'bazel clean'.

This unhandled IOException causes Bazel to fail to print the original
cause of the problem that drove it into `logAndThrowOrRecurse()`.

We here attempt to improve the reporting and allow Bazel to survive the problem.
@github-actions github-actions Bot added team-Performance Issues for Performance teams awaiting-review PR is awaiting review from an assigned reviewer labels Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Performance Issues for Performance teams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant