-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roachtest: reduce hangs in acceptance-chaos tests #37205
Conversation
These tests are pretty janky, and can end up failing with a timeout and a deadlocked test, which is not something roachtest can really ever handle gracefully. Sprinkle more contexts around and set a statement timeout for the central query that is most likely to get stuck under the crucial lock that we think "causes" most of the deadlocks. Of course there is likely a real problem with CRDB, which this PR does nothing about. All that is (hopefully) achieved here is a clean failure mode. The failure prompting this PR is fixed by cockroachdb#37204, unfortunately it also turns out that the statement timeout added in this PR did not prevent the statement from hanging. It is probably still worth merging this. Release note: None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I'm science 🐶 here... I got lost in #37200 and its relationship with this bank test. What are the deadlocks you are complaining about?
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)
pkg/cmd/roachtest/bank.go, line 66 at r1 (raw file):
SET statement_timeout = '31s'; UPDATE bank.accounts SET balance = CASE id WHEN %[1]d THEN balance-%[3]d WHEN %[2]d THEN balance+%[3]d END
how come you moved to string interpolation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acceptance/bank/cluster-recovery runs this code. This code has this lock around the clients
slice. If queries don't return in a timely manner (particular the update txn), the test will deadlock because the RLock is never released.
TFTR!
bors r=andreimatei
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei)
pkg/cmd/roachtest/bank.go, line 66 at r1 (raw file):
I think you missed the comment in the code:
Run with a statement timeout, which unfortunately precludes the use of prepared statements.
37205: roachtest: reduce hangs in acceptance-chaos tests r=andreimatei a=tbg These tests are pretty janky, and can end up failing with a timeout and a deadlocked test, which is not something roachtest can really ever handle gracefully. Sprinkle more contexts around and set a statement timeout for the central query that is most likely to get stuck under the crucial lock that we think "causes" most of the deadlocks. Of course there is likely a real problem with CRDB, which this PR does nothing about. All that is (hopefully) achieved here is a clean failure mode. The failure prompting this PR is fixed by #37204, unfortunately it also turns out that the statement timeout added in this PR did not prevent the statement from hanging. It is probably still worth merging this. Release note: None Co-authored-by: Tobias Schottdorf <[email protected]>
Build succeeded |
These tests are pretty janky, and can end up failing with a timeout and
a deadlocked test, which is not something roachtest can really ever
handle gracefully. Sprinkle more contexts around and set a statement
timeout for the central query that is most likely to get stuck under the
crucial lock that we think "causes" most of the deadlocks.
Of course there is likely a real problem with CRDB, which this PR does
nothing about. All that is (hopefully) achieved here is a clean failure
mode. The failure prompting this PR is fixed by #37204, unfortunately
it also turns out that the statement timeout added in this PR did not
prevent the statement from hanging. It is probably still worth merging
this.
Release note: None