[CORE-16779] rptest: add _call_with_leader_retry for metastore util functions#31017
Open
WillemKauf wants to merge 1 commit into
Open
[CORE-16779] rptest: add _call_with_leader_retry for metastore util functions#31017WillemKauf wants to merge 1 commit into
rptest: add _call_with_leader_retry for metastore util functions#31017WillemKauf wants to merge 1 commit into
Conversation
Tests can flake because of `metastore` RPCs returning transient `UNAVAILABLE` errors due to leadership movements. Add a `_call_with_leader_retry()` function and wrap the existing `metastore` utilities in it.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces rptest flakiness in cloud-topics tests by adding a small retry wrapper for metastore RPCs that can transiently fail with UNAVAILABLE during leadership changes.
Changes:
- Add
_call_with_leader_retry()to retry metastore RPCs onConnectErrorCode.UNAVAILABLE. - Wrap
read_rows,list_cloud_topics, andget_sizecalls in the new retry helper.
Comment on lines
+21
to
+28
| deadline = time.time() + timeout_sec | ||
| while True: | ||
| try: | ||
| return call() | ||
| except ConnectError as e: | ||
| if e.code != ConnectErrorCode.UNAVAILABLE or time.time() >= deadline: | ||
| raise | ||
| time.sleep(backoff_sec) |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests can flake because of
metastoreRPCs returning transientUNAVAILABLEerrors due to leadership movements.Add a
_call_with_leader_retry()function and wrap the existingmetastoreutilities in it.Backports Required
Release Notes