Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151420

Change subject: Ensure connection exists before writing to it
......................................................................

Ensure connection exists before writing to it

Change-Id: I96f310b7eccbd3f868cd6a833cee0f6a42a51244
---
M quarry/web/worker.py
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/20/151420/1

diff --git a/quarry/web/worker.py b/quarry/web/worker.py
index 8466a00..048c9e0 100644
--- a/quarry/web/worker.py
+++ b/quarry/web/worker.py
@@ -66,6 +66,7 @@
 
 @celery.task(name='worker.kill_query')
 def kill_query(thread_id):
+    g.conn.replica.ping(reconnect=True)
     cur = g.conn.replica.cursor()
     try:
         cur.execute("KILL QUERY %s", thread_id)
@@ -93,6 +94,7 @@
         if check_result is not True:
             celery_log.info("Check result for qrun:%s failed, with message: 
%s", qrun.id, check_result[0])
             raise pymysql.DatabaseError(0, check_result[1])
+        g.conn.replica.ping(reconnect=True)
         cur = g.conn.replica.cursor()
         cur.execute(qrun.query_rev.text)
         result = []

-- 
To view, visit https://gerrit.wikimedia.org/r/151420
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96f310b7eccbd3f868cd6a833cee0f6a42a51244
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to