Skip to content

fix(sheet): record executor-close cleanup failures like the other steps - #1359

Open
Sean-Walker0 wants to merge 1 commit into
apache:mainfrom
Sean-Walker0:fix/executor-close-failure-record
Open

Sean-Walker0 wants to merge 1 commit into
apache:mainfrom
Sean-Walker0:fix/executor-close-failure-record

Conversation

@Sean-Walker0

Copy link
Copy Markdown
Contributor

Purpose of the pull request

The executor-close cleanup step introduced with #1070 assigns its caught throwable directly:

} catch (Throwable t) {
    throwable = t;   // the only cleanup block not using recordFailure
}

It is the only one of the seven cleanup blocks in ExcelAnalyserImpl.finish() not using recordFailure — the pattern the sibling blocks were unified onto by #1205 (which established "first failure is the cause, later ones are suppressed" for this exact method). When an earlier cleanup step (the read-cache destroy) has already failed, a failing executor close overwrites the recorded failure: callers see the secondary exception and the original cause is lost.

No issue exists for this yet; found by sibling-comparison while reviewing the newly merged #1070.

What's changed?

One line: the block uses recordFailure(throwable, t) like every sibling, keeping the first failure as the cause and attaching the executor-close failure as suppressed.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Verifying this change

ExecutorCloseFailureRecordTest — mocks a ReadCache whose destroy() fails and an ExcelReadExecutor whose close() then fails, drives the real finish() logic:

  • red before (the read-cache destroy failure happened first and must stay the cause ... was: executor close failed);

  • green after: the destroy failure stays the cause, the close failure is attached as suppressed.

  • Existing ExcelAnalyserImplTest (the fix: keep the first read-side cleanup failure and suppress later ones (#1204) #1205 regression test): still green.

  • ./mvnw clean package -B -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet: 1920 tests, 0 failures.

  • ./mvnw -pl fesod-sheet spotless:check: clean.

Notes

The executor-close step added with apache#1070 assigned its caught throwable
directly (throwable = t), the only one of the seven cleanup blocks in
ExcelAnalyserImpl.finish() not using recordFailure - the pattern every
other block was unified onto by apache#1205. When an earlier cleanup step
(the read-cache destroy) had already failed, a failing executor close
overwrote the recorded failure, so callers saw the secondary exception
and the original cause was lost.

Use recordFailure like the sibling blocks: the first failure stays the
cause and the later one is attached as suppressed.

Verified with ExecutorCloseFailureRecordTest (a read-cache destroy
failure followed by a failing executor close: before the change the
executor exception overwrites the cause, after it the destroy failure
stays the cause with the close failure suppressed) plus the existing
ExcelAnalyserImplTest, the full fesod-sheet suite (1920 tests) and
spotless:check.

This branch has not been deployed

No deployments
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.

1 participant