Skip to content

Conversation

RaduBerinde
Copy link
Member

The asynchronous code that polls for the URL file leads to very opaque failures. This change reworks this code to waiting synchronously, so that we know the server is started before we return. In cases of failure, we now get more useful errors.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

} else if !os.IsNotExist(err) {
return fmt.Errorf("unexpected error while reading listening URL file: %w", err)
}
if err != nil && !os.IsNotExist(err) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: left conjunct is a tautology, it can be dropped.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not, when data is empty. I'll refactor a bit so it's less subtle.

TFTR!

Copy link
Member

Choose a reason for hiding this comment

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

Right, 🤦 .

Copy link
Member Author

Choose a reason for hiding this comment

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

Cleaned it up a little.

The asynchronous code that polls for the URL file leads to very opaque
failures. This change reworks this code to waiting synchronously, so
that we know the server is started before we return. In cases of
failure, we now get more useful errors.
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