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

Method _check_for_memory_errors

tests/stress/query_runner.py:290–316  ·  view source on GitHub ↗

To be called after a query failure to check for signs of failed due to a mem limit or admission control rejection/timeout. The report will be updated accordingly.

(self, report, cursor, caught_exception)

Source from the content-addressed store, hash-verified

288 report.query_id, e)
289
290 def _check_for_memory_errors(self, report, cursor, caught_exception):
291 """To be called after a query failure to check for signs of failed due to a
292 mem limit or admission control rejection/timeout. The report will be updated
293 accordingly.
294 """
295 fetch_and_set_profile(cursor, report)
296 caught_msg = str(caught_exception).lower().strip()
297 # Distinguish error conditions based on string fragments. The AC rejection and
298 # out-of-memory conditions actually overlap (since some memory checks happen in
299 # admission control) so check the out-of-memory conditions first.
300 if "memory limit exceeded" in caught_msg or \
301 "repartitioning did not reduce the size of a spilled partition" in caught_msg or \
302 "failed to get minimum memory reservation" in caught_msg or \
303 "minimum memory reservation is greater than" in caught_msg or \
304 "minimum memory reservation needed is greater than" in caught_msg:
305 report.not_enough_memory = True
306 return
307 if "rejected query from pool" in caught_msg:
308 report.ac_rejected = True
309 return
310 if "admission for query exceeded timeout" in caught_msg:
311 report.ac_timedout = True
312 return
313
314 LOG.debug("Non-mem limit error for query with id %s: %s", report.query_id,
315 caught_exception, exc_info=True)
316 report.other_error = caught_exception
317
318 def _fetch_and_hash_result(self, cursor, timeout_unix_time, query):
319 """Fetches results from 'cursor' and returns a hash that is independent of row order.

Callers 1

run_queryMethod · 0.95

Calls 2

fetch_and_set_profileFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected