Skip to content

Add a try_fail_point! macro and use it in more places#4259

Merged
jmarrero merged 1 commit intocoreos:mainfrom
cgwalters:failpoint-dbus
Jan 12, 2023
Merged

Add a try_fail_point! macro and use it in more places#4259
jmarrero merged 1 commit intocoreos:mainfrom
cgwalters:failpoint-dbus

Conversation

@cgwalters
Copy link
Member

When I was debugging https://issues.redhat.com/browse/OCPBUGS-2866 it would have been quite convenient to have a failpoint set up in the transaction init path, because I could have forcibly injected a sleep there.

Add one there, and in a few other places I semi-randomly chose by skimming through the code. The cost of this is very low, but if we find other bugs in the future it will likely be useful.

Further, we can and should start using failpoints to forcibly inject errors in our CI tests.

Since movement on review of tikv/fail-rs#68 has been slow, we just copy the code into our repo for now.

When I was debugging https://issues.redhat.com/browse/OCPBUGS-2866
it would have been quite convenient to have a failpoint set up
in the transaction init path, because I could have forcibly injected
a sleep there.

Add one there, and in a few other places I semi-randomly
chose by skimming through the code.  The cost of this is very low,
but if we find other bugs in the future it will likely be useful.

Further, we can and should start using failpoints to forcibly
inject errors in our CI tests.

Since movement on review of tikv/fail-rs#68
has been slow, we just copy the code into our repo for now.
@cgwalters
Copy link
Member Author

To use this do e.g.: systemctl edit rpm-ostreed, then inject

[Service]
Environment=FAILPOINTS=transaction::execute=return

Then systemctl restart rpm-ostreed, and all transactions will return an error.

@jmarrero jmarrero enabled auto-merge January 12, 2023 18:44
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

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.

2 participants