MCPcopy Create free account
hub / github.com/apache/impala / _wait_until_cancelled

Method _wait_until_cancelled

tests/stress/query_runner.py:245–259  ·  view source on GitHub ↗

Wait until 'cursor' is in a CANCELED or ERROR status.

(self, cursor, query_id)

Source from the content-addressed store, hash-verified

243 secs_since_log += sleep_secs
244
245 def _wait_until_cancelled(self, cursor, query_id):
246 """Wait until 'cursor' is in a CANCELED or ERROR status."""
247 last_log_time = 0
248 status = cursor.status()
249 while status not in ["CANCELED_STATE", "ERROR_STATE"]:
250 # Work around IMPALA-7561: queries don't transition out of FINISHED state once they
251 # hit eos.
252 if status == "FINISHED_STATE" and "Last row fetched" in cursor.get_profile():
253 return
254 if time() - last_log_time > 5:
255 LOG.debug("Waiting for query with id {query_id} to be cancelled".format(
256 query_id=query_id))
257 last_log_time = time()
258 sleep(0.1)
259 status = cursor.status()
260
261 def update_from_query_report(self, report):
262 LOG.debug("Updating runtime stats (Query Runner PID: {0})".format(self.proc.pid))

Callers 1

run_queryMethod · 0.95

Calls 4

timeFunction · 0.85
statusMethod · 0.45
debugMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected