fix: debug stuck process by sending SIGUSR1
It will print stack to stderr.
This commit is contained in:
parent
0a81407304
commit
6560d4587a
1 changed files with 7 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ be used to build database driven apps.
|
|||
Read the documentation: https://frappeframework.com/docs
|
||||
"""
|
||||
import copy
|
||||
import faulthandler
|
||||
import functools
|
||||
import gc
|
||||
import importlib
|
||||
|
|
@ -18,6 +19,7 @@ import inspect
|
|||
import json
|
||||
import os
|
||||
import re
|
||||
import signal
|
||||
import traceback
|
||||
import warnings
|
||||
from collections.abc import Callable
|
||||
|
|
@ -304,6 +306,7 @@ def init(site: str, sites_path: str = ".", new_site: bool = False, force=False)
|
|||
if not _qb_patched.get(local.conf.db_type):
|
||||
patch_query_execute()
|
||||
patch_query_aggregation()
|
||||
_register_fault_handler()
|
||||
|
||||
setup_module_map(include_all_apps=not (frappe.request or frappe.job or frappe.flags.in_migrate))
|
||||
|
||||
|
|
@ -2542,6 +2545,10 @@ def validate_and_sanitize_search_inputs(fn):
|
|||
return wrapper
|
||||
|
||||
|
||||
def _register_fault_handler():
|
||||
faulthandler.register(signal.SIGUSR1)
|
||||
|
||||
|
||||
from frappe.utils.error import log_error
|
||||
|
||||
if _tune_gc:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue