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

Fix address already in use detection. #147

Merged
merged 1 commit into from
Oct 1, 2019
Merged

Conversation

hpidcock
Copy link
Member

@hpidcock hpidcock commented Oct 1, 2019

At some point mongo's address in use error changed. This will fix retry on address in use error.

mgo.go Outdated
if strings.Contains(buf.String(), "addr already in use") {
out := buf.String()
if strings.Contains(out, "addr already in use") ||
strings.Contains(out, "Address already in use") {
Copy link
Member

Choose a reason for hiding this comment

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

What's the chances, strings.Contains(out, "already in use") would be a better fit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah good point, I thought I should be specific in-case behaviour changed again in Mongo, but it's only for testing.

@hpidcock
Copy link
Member Author

hpidcock commented Oct 1, 2019

$$merge$$

@jujubot jujubot merged commit ce9dec1 into juju:master Oct 1, 2019
jujubot added a commit to juju/juju that referenced this pull request Oct 2, 2019
#10669

## Description of change

Update testing package with mongo port in use fix.
juju/testing#147

## QA steps

Run the state package unit tests.

## Documentation changes

N/A

## Bug reference

N/A
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