• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

allegro / ralph / 6584
85%

Build:
DEFAULT BRANCH: ng
Ran 03 Aug 2016 09:08AM UTC
Jobs 1
Files 201
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6584

push

travis-ci

web-flow
Worker class handling database connection timeout (#2660)

Handles connection (wait) timeouts on RQ.

If idle time of the worker exceeds wait timeout for connection to the
database (for MySQL it's 8 hours by default), connection is closed by
database server, but Django still thinks it has open connection to the
DB. This ends with errors like 'Lost connection to MySQL server' or
'MySQL server has gone away' (or similar for other backends).

Solution below fixes this bug by closing connections before and after
each job on worker and forcing Django to open a new one.

This comes in pair with `CONN_MAX_AGE` settings (https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-CONN_MAX_AGE).
To properly handle closing connection when using persistent connections
to the database, it's value should be lower than wait timeout of the
database server.

Resources:
* https://github.com/translate/pootle/issues/4094
* http://dev.mysql.com/doc/refman/5.7/en/gone-away.html
* https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html
* http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout

10670 of 12576 relevant lines covered (84.84%)

0.85 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
9
100.0
src/ralph/accounts/views.py
21
100.0
src/ralph/ralph2_sync/subscribers.py
21
100.0
src/ralph/accounts/admin.py
25
100.0
src/ralph/back_office/models.py
43
100.0
src/ralph/deployment/deployment.py
Jobs
ID Job ID Ran Files Coverage
2 6584.2 (DJANGO_VERSION=1.8.12 TEST_DB_ENGINE=mysql) 03 Aug 2016 09:08AM UTC 0
84.84
Travis Job 6584.2
Source Files on build 6584
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6584
  • b6a93585 on github
  • Prev Build on ng (#6579)
  • Next Build on ng (#6588)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc