Skip to content
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

logictest: use a retry loop when starting testserver #98528

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Mar 13, 2023

A similar change was already made for upgrading the node.

informs #94956

Release note: None

A similar change was already made for upgrading the node.

Release note: None
@rafiss rafiss requested a review from renatolabs March 13, 2023 20:49
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@renatolabs renatolabs left a comment

Choose a reason for hiding this comment

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

LGTM.

Do you have the context for the backwards compatibility we are trying to achieve here?

https://github.com/cockroachdb/cockroach-go/blob/d51b7cdc21ea0529ca81ed61c313e44763d0ac3e/testserver/testserver.go#L422-L425

It would be nice if the absence of custom ports meant the testserver bound to :0 (i.e., let the kernel choose). It would eliminate the flakes we're seeing and we wouldn't need to perform any retries from logictest.

@rafiss
Copy link
Collaborator Author

rafiss commented Mar 13, 2023

Here's where that change was made: cockroachdb/cockroach-go#145

I believe the thinking was that any users of the library before that PR might have been writing tests that relied on the port to be fixed.

The hardcoding of ports was first added here: cockroachdb/cockroach-go#141. The reason it was added was because when stopping/restarting a node during the upgrade, you need to make sure it is listening on the same port as it was before. Otherwise other nodes won't be able to join it in the cluster.

However, I bet we can do better, maybe by referring back to the port that was in the listen-url file. I'll try to improve this in cockroach-go, but will merge this for now.

bors r=renatolabs

@craig
Copy link
Contributor

craig bot commented Mar 13, 2023

Build failed:

@rafiss
Copy link
Collaborator Author

rafiss commented Mar 13, 2023

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 13, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 14, 2023

Build succeeded:

@craig craig bot merged commit 2ac6e51 into cockroachdb:master Mar 14, 2023
@rafiss rafiss deleted the retry-logictest branch March 14, 2023 22:15
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.

3 participants