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

allegro / ralph / 6559
85%

Build:
DEFAULT BRANCH: ng
Ran 02 Aug 2016 07:57PM UTC
Jobs 1
Files 200
Run time 33s
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
6559

Pull #2660

travis-ci

web-flow
Worker class handling database connection timeout

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
Pull Request #2660: Worker class handling database connection timeout

10598 of 12485 relevant lines covered (84.89%)

0.85 hits per line

Jobs
ID Job ID Ran Files Coverage
2 6559.2 (DJANGO_VERSION=1.8.12 TEST_DB_ENGINE=mysql) 02 Aug 2016 07:57PM UTC 0
84.89
Travis Job 6559.2
Source Files on build 6559
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6559
  • Pull Request #2660
  • PR Base - ng (#6551)
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