Page MenuHomePhabricator

Time limit on quarry queries
Closed, DuplicatePublic

Description

We have many quarry queries running for months, like [http://quarry.wmflabs.org/query/4625] or [http://quarry.wmflabs.org/query/4196] ("select 1" query). There should be an easy way for the user to kill his/her query. Also new queries could set a time after which a query would be killed. A default would be short (24 hours ?) but longer times would be allowed.

Event Timeline

Jarekt raised the priority of this task from to Needs Triage.
Jarekt updated the task description. (Show Details)
Jarekt added a project: Quarry.
Jarekt subscribed.

Those aren't actually running for months, I think - those happen when for some reason there's an unhandled exception in the query results serializer, preventing it from updating the status accordingly...

Need to dig in and take a look. By default queries get killed after 20mins.

Ok So you are saying I should stop waiting for my http://quarry.wmflabs.org/query/5045 query results? ;)

If they are all killed after 20 min., as queries from other tools like CatScan2, than no need for " easy way for the user to kill" queries, but it would be nice to be notified.

Yes, that seems to have been a bug that I hopefully have fixed :) Usually when they get killed they get their status set to 'killed' but apparently not that one.

Now queries get killed in 30min.

yuvipanda, it seems like there is still a problem, as http://quarry.wmflabs.org/query/2556 is running for 2 hours now. By the way, is there a way to get this query to go faster?

So I can confirm that it does get killed in 30min but just doesn't get reflected in the status. I'm investigating why

Nov 10 00:21:23 quarry-runner-01 celery[29630]: Traceback (most recent call last):
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
Nov 10 00:21:23 quarry-runner-01 celery[29630]: R = retval = fun(*args, **kwargs)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
Nov 10 00:21:23 quarry-runner-01 celery[29630]: return self.run(*args, **kwargs)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/srv/quarry/quarry/web/worker.py", line 102, in run_query
Nov 10 00:21:23 quarry-runner-01 celery[29630]: cur.close()
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/cursors.py", line 59, in close
Nov 10 00:21:23 quarry-runner-01 celery[29630]: while self.nextset():
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/cursors.py", line 90, in nextset
Nov 10 00:21:23 quarry-runner-01 celery[29630]: conn.next_result()
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 730, in next_result
Nov 10 00:21:23 quarry-runner-01 celery[29630]: self._affected_rows = self._read_query_result()
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 861, in _read_query_result
Nov 10 00:21:23 quarry-runner-01 celery[29630]: result.read()
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 1070, in read
Nov 10 00:21:23 quarry-runner-01 celery[29630]: self._read_result_packet(first_packet)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 1110, in _read_result_packet
Nov 10 00:21:23 quarry-runner-01 celery[29630]: self._get_descriptions()
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 1183, in _get_descriptions
Nov 10 00:21:23 quarry-runner-01 celery[29630]: field = self.connection._read_packet(FieldDescriptorPacket)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 825, in _read_packet
Nov 10 00:21:23 quarry-runner-01 celery[29630]: packet = packet_type(self)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 385, in __init__
Nov 10 00:21:23 quarry-runner-01 celery[29630]: self.__parse_field_descriptor(connection.encoding)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 394, in __parse_field_descriptor
Nov 10 00:21:23 quarry-runner-01 celery[29630]: self.table_name = self.read_length_coded_string().decode(encoding)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
Nov 10 00:21:23 quarry-runner-01 celery[29630]: return codecs.utf_8_decode(input, errors, True)
Nov 10 00:21:23 quarry-runner-01 celery[29630]: UnicodeDecodeError: 'utf8' codec can't decode byte 0xca in position 9: invalid continuation byte

is what it fails with, thus preventing it from marking the query as failed.