Skip to content

Commit

Permalink
Log memory errors when to debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Dec 15, 2023
1 parent 9c82f4b commit 04b4db6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wakaq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, pid, stdin, pingin, broadcastout):
os.set_blocking(stdin, False)
os.set_blocking(pingin, False)
os.set_blocking(broadcastout, False)
self.current_task = None
self.pid = pid
self.stdin = stdin
self.pingin = pingin
Expand Down Expand Up @@ -259,8 +260,8 @@ def _child(self, stdout, pingout, broadcastin):
except:
# give task back to queue so it's not lost
self.wakaq.broker.lpush(queue_broker_key, serialize(payload))
self._stop_processing = True
return
current_task.set(None)
raise

try:
self._execute_task(task, payload, queue=queue)
Expand Down Expand Up @@ -324,6 +325,11 @@ def _child(self, stdout, pingout, broadcastin):
if current_task.get():
raise

except (MemoryError, BlockingIOError):
if current_task.get():
raise
log.debug(traceback.format_exc())

except Exception as e:
if exception_in_chain(e, SoftTimeout):
if current_task.get():
Expand Down

0 comments on commit 04b4db6

Please sign in to comment.