On 8/01/2015 22:47, Feico de Boer wrote:
Each morning I encounter the following error.
         OperationalError('(OperationalError) (2006, "MySQL server has
gone away (error(32, \\'Broken pipe\\'))")',)

And thus the first sync fails. This of course is due to the MySQL
default connection timeout setting of 28800 seconds (8 hours). Although
slightly annoying it is not a huge issue because the connection is
restored after this.

Should the following fix be sufficient to circumvent this error?

 >~~~~~~~<
weave:~/syncserver/syncserver$ git diff staticnode.py
diff --git a/syncserver/staticnode.py b/syncserver/staticnode.py
index d758aad..1b3b76c 100644
--- a/syncserver/staticnode.py
+++ b/syncserver/staticnode.py
@@ -118,6 +118,12 @@ class StaticNodeAssignment(object):
              if urlparse.urlparse(sqluri).path.lower() in ("/",
"/:memory:"):
                  sqlkw["pool_size"] = 1
                  sqlkw["max_overflow"] = 0
+        if self.driver == "pymysql":
+            sqlkw["pool_recycle"] = 3600


Indeed, we set a default pool_recycle for our production services but I must have overlooked it here. I've made the fix in the following commit:


https://github.com/mozilla-services/syncserver/commit/d95c1e6a4f8a3fb608701cf7bc45dd31884ec12f


Thanks!


  Ryan
_______________________________________________
Sync-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/sync-dev

Reply via email to