Skip to content

[tx] add recover in tx.check#1164

Merged
ahrtr merged 1 commit intoetcd-io:mainfrom
VihasMakwana:tx-check-panic
Mar 12, 2026
Merged

[tx] add recover in tx.check#1164
ahrtr merged 1 commit intoetcd-io:mainfrom
VihasMakwana:tx-check-panic

Conversation

@VihasMakwana
Copy link
Contributor

tx.check is called in a goroutine inside tx.Check when using strict mode. tx.check performs checks on page flags and page id and it panics in the goroutine if type the database is corrupted. This panic, however, is not recovered and can cause the entire process to crash.
This PR adds recover call and passes the error to the caller.

Testing

I have added a unit test for this fix. This test would fail without the recover.

Signed-off-by: VihasMakwana <121151420+VihasMakwana@users.noreply.github.com>
@VihasMakwana
Copy link
Contributor Author

@ahrtr Could you take a look when you're around? There's only one commit in this PR and it should be good to go .

@ahrtr
Copy link
Member

ahrtr commented Mar 12, 2026

/ok-to-test

@VihasMakwana
Copy link
Contributor Author

Nice! CI is green.

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

Thank you!

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, VihasMakwana

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr ahrtr merged commit 73ea466 into etcd-io:main Mar 12, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants