-
Notifications
You must be signed in to change notification settings - Fork 33
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
amulet run hangs #184
Comments
How do you know it's hung? How long are you waiting? Amulet tries to wait until the deployment has settled (all agents idle) before sentry.wait() returns. |
So it seems to complete after about 2 hours. I've added some debugging output to the test as follows:
From that, the bulk of the time seems to be within amulet.Deployment.setup():
Full output in pastebin - http://paste.ubuntu.com/25280876/ I'm using snaps for juju:
This is with the latest amulet from GitHub (so commit f1a5bad). |
I added a wrapper to juju in a path before the snap path and it seems to be hanging on this:
From that, I found it's hanging on subprocess.communicate and was able to reproduce it:
I think we could add a timeout to subprocess.communicate() calls, but that breaks with earlier versions of python (timeout was introduced in 3.3) |
There's cases where amulet would hang for long periods of time (hours and hours). It seems this is due to subprocess.communicate() calls blocking with hung juju processes (see GitHub juju#184). This updates calls to use a hard timeout. Unfortunately, timeout was introduced in Python 3.3. so this breaks for older versions of Python.
This isn't a fix for why the juju commands are hanging, so will still need to look into that. |
Hi,
Trying to run the amulet tests against changes I made to the graylog charm[1], amulet hangs inside deployer.setup() and I'm not sure why.
| [hloeung@dharkan graylog]$ python3 tests/10-basic.py
| 2017-08-09 17:50:10 Starting deployment of canonistack-haw-lcy02:admin/default
| 2017-08-09 17:50:15 Deploying applications...
| 2017-08-09 17:50:15 Deploying application apache2 using cs:xenial/apache2-21
| 2017-08-09 17:50:22 Deploying application elasticsearch using cs:~elasticsearch-charmers/xenial/elasticsearch-0
| 2017-08-09 17:50:29 Deploying application graylog using /tmp/charmexvatjhf/xenial/graylog
| 2017-08-09 17:50:51 Deploying application mongodb using cs:xenial/mongodb-43
| 2017-08-09 17:56:40 Adding relations...
| 2017-08-09 17:56:40 Adding relation graylog:mongodb <-> mongodb:database
| 2017-08-09 17:56:40 Adding relation graylog:elasticsearch <-> elasticsearch:client
| 2017-08-09 17:56:41 Adding relation graylog:website <-> apache2:reverseproxy
| 2017-08-09 17:57:46 Deployment complete in 455.78 seconds
(hangs here)
Process listing shows a hung juju process:
| 21901 pts/6 S+ 0:00 | _ python3 tests/10-basic.py
| 23540 pts/6 Z+ 0:00 | _ [juju]
I've had someone else in my team also able to reproduce this so it's not my local set up.
[1]https://code.launchpad.net/~hloeung/graylog-charm/+git/graylog-charm
The text was updated successfully, but these errors were encountered: