mongo test server should restart when address already in use

Bug #1301467 reported by Roger Peppe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Andrew Wilkins

Bug Description

One cause of intermittent test failures is when mongo fails because of a port
in use. Although we try to pick a new unused port, there is no guarantee that
some other process will not have grabbed it by the time mongo tries to
bind to it. Currently if this happens, we see a test timeout.

Here's an example of a test that failed like that:

https://pastebin.canonical.com/107661/

As a first step, we could monitor the mongo output
for an occurrence of the string

"ERROR: listen(): bind() failed errno:98 Address already in use for socket".

and panic if we saw that.

Better would be to monitor the output for some indication that
the mongo server has actually successfully bound to the port,
and don't return from the mongo instance creation code until
that happens, which would enable us to restart the mongod automatically
in this case.

Related branches

Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: intermittent-failure test-failure
Ian Booth (wallyworld)
Changed in juju-core:
milestone: none → 1.19.3
Andrew Wilkins (axwalk)
Changed in juju-core:
assignee: nobody → Andrew Wilkins (axwalk)
status: Triaged → In Progress
Andrew Wilkins (axwalk)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.