APM faulthandler from cfg file

Register faulthandler in case apm options is True because some other process get AttributeError fileno
(celery)
This commit is contained in:
Raimon Esteve 2016-11-24 17:31:43 +01:00
parent b79b8ca2b6
commit 4c059c9007
1 changed files with 7 additions and 3 deletions

View File

@ -39,13 +39,16 @@ diff -r 649b0805fa93 trytond/protocols/dispatcher.py
diff -r 649b0805fa93 trytond/protocols/top.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/trytond/trytond/protocols/top.py Sun Apr 19 03:18:20 2015 +0200
@@ -0,0 +1,90 @@
@@ -0,0 +1,94 @@
+import random
+import signal
+import locale
+import faulthandler
+from operator import itemgetter
+from datetime import datetime
+from trytond.config import config as config_
+
+APM = config_.getboolean('optional', 'apm', default=True)
+
+current_actions = {}
+action_id = 0
@ -113,8 +116,9 @@ diff -r 649b0805fa93 trytond/protocols/top.py
+ pprint_table(table)
+ print '=' * 30
+
+signal.signal(signal.SIGUSR1, signal_user_handler)
+faulthandler.register(signal.SIGUSR2)
+if APM:
+ signal.signal(signal.SIGUSR1, signal_user_handler)
+ faulthandler.register(signal.SIGUSR2)
+
+
+def add(value):