Merge lp://staging/~caio1982/capomastro/celery-fixes into lp://staging/capomastro
Status: | Merged |
---|---|
Approved by: | Daniel Manrique |
Approved revision: | 190 |
Merged at revision: | 188 |
Proposed branch: | lp://staging/~caio1982/capomastro/celery-fixes |
Merge into: | lp://staging/capomastro |
Diff against target: |
30 lines (+8/-1) 2 files modified
capomastro/settings.py (+7/-0) debian/capomastro.init (+1/-1) |
To merge this branch: | bzr merge lp://staging/~caio1982/capomastro/celery-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Manrique (community) | Approve | ||
Review via email: mp+257597@code.staging.launchpad.net |
Commit message
Update configuration to suppress spurious/annoying messages in celery log.
The serializer one is a deprecation warning for the next version of Celery.
The other one was actually a bug. Reading the documentation of the version we use it seems the beat process cannot be started multiple times. Setting concurrency to 1 works around that problem.
Description of the change
These fix some annoying messages I was seeing in the Celery log of Capomastro.
The serializer one is a deprecation warning for the next version of Celery.
The other one was actually a bug. Reading the documentation of the version we use it seems the beat process cannot be started multiple times. Since by default Celery spawns as many process as the number of CPUs you have, we were having like four beats around. Some of them suddenly started to die and left Python defuncts all over.
You could see this nonsense in the log, multiple times:
[2015-04-27 18:03:40,669: ERROR/MainProcess] consumer: Cannot connect to amqp://
Though it didn't bother Capomastro, eventually those defuncts would be still there and Celery would never shut down cleanly.
It's possible to have both beat and the worker together, as long we use a max concurrency value, which this MR changes to 1 just like Hexr does (and if a beast like Hexr is happy with that I suppose we will be too!).
I have been running multiple immediate and scheduled builds on staging for the whole day with that change and it seems all beautiful and good smelling; totally the opposite of the previous command line, which would leave defuncts behind after minutes.
Hey. Three observations:
- Use a more readable commit message pattern with the summary separate from the description. This is standard practice and it helps for readability and changelog maintenance. Use proper capitalization for sentences. Use sentences instead of a long chain of commas. This might seem picky but looking at the commit messages just makes them look sloppy to me.
- Using database as as scheduler is a hack IMHO. It's a busy loop (with a sleep inside) that just keeps poking the database. I suspect using rabbit is a standard practice in Canonical and using it would definitely cut the load on the database as it's purely event based.
- Using --concurrency=1 to fix issues also feels very much wrong. Defunct processes are just zombies. I suspect that using concurrency=1 just runs everything in the master process so you don't get zombies but this just hides the real problem.
Thanks
ZK