mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
Merge pull request #54543 from AssemBahnasy/fix/repost-recoverable-errors-status
fix: use RecoverableErrors isinstance check for repost timeout status
This commit is contained in:
@@ -356,8 +356,15 @@ def repost(doc):
|
|||||||
message = message.get("message")
|
message = message.get("message")
|
||||||
|
|
||||||
status = "Failed"
|
status = "Failed"
|
||||||
# If failed because of timeout, set status to In Progress
|
# If failed because of a recoverable error (timeout, deadlock), set status to In Progress
|
||||||
if traceback and ("timeout" in traceback.lower() or "Deadlock found" in traceback):
|
# so the scheduler automatically retries instead of leaving it permanently failed.
|
||||||
|
# NOTE: isinstance check comes first because the traceback string matching is unreliable
|
||||||
|
# when SIGALRM kills the process mid-C-extension (JobTimeoutException may not appear
|
||||||
|
# in the traceback if the exception handler itself was interrupted).
|
||||||
|
traceback_lower = traceback.lower() if traceback else ""
|
||||||
|
if isinstance(e, RecoverableErrors) or (
|
||||||
|
traceback_lower and ("timeout" in traceback_lower or "deadlock found" in traceback_lower)
|
||||||
|
):
|
||||||
status = "In Progress"
|
status = "In Progress"
|
||||||
|
|
||||||
if traceback:
|
if traceback:
|
||||||
|
|||||||
Reference in New Issue
Block a user