[Django]-Lots of socket errors with celery eventlet tasks

6👍

✅

The problem was a side effect of some code that was blocking. I managed to detect the blocking code using the eventlet option described in this article.

There were 2 places where blocking was occuring: DNS lookups, and MySQL database access. I managed to resolve the first by installing the dnspython package, and the second my using the undocumented MySQLdb option in eventlet:

import eventlet
eventlet.monkey_patch()
eventlet.monkey_patch(MySQLdb=True)

Leave a comment