summaryrefslogtreecommitdiff
path: root/odoo/service
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-09-24 16:59:15 +0000
committerChristophe Simonis <chs@odoo.com>2019-09-24 17:45:37 +0000
commitd67b2483e5bfa5d8c1e6ef1a64fb933f5e080ad5 (patch)
tree25a7fd39ac993f3c04c5d8408beb628b3c9948ce /odoo/service
parent38d8b0526f0fccc32df5a11f5d086a3522ed5fcf (diff)
parent9ed4872ea03f28012118ed48a43d0800617a84f3 (diff)
[MERGE] forward port branch saas-12.4 up to 9ed4872ea03
closes odoo/odoo#37372 Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'odoo/service')
-rw-r--r--odoo/service/model.py1
-rw-r--r--odoo/service/server.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/odoo/service/model.py b/odoo/service/model.py
index 9673b6f98c9..82a32c2cfc1 100644
--- a/odoo/service/model.py
+++ b/odoo/service/model.py
@@ -157,6 +157,7 @@ def check(f):
return wrapper
def execute_cr(cr, uid, obj, method, *args, **kw):
+ odoo.api.Environment.reset() # clean cache etc if we retry the same transaction
recs = odoo.api.Environment(cr, uid, {}).get(obj)
if recs is None:
raise UserError(_("Object %s doesn't exist") % obj)
diff --git a/odoo/service/server.py b/odoo/service/server.py
index 15d3009e36b..7ff35146a85 100644
--- a/odoo/service/server.py
+++ b/odoo/service/server.py
@@ -507,6 +507,8 @@ class ThreadedServer(CommonServer):
# We wait there is no processing requests
# other than the ones exceeding the limits, up to 1 min,
# before asking for a reload.
+ _logger.info('Dumping stacktrace of limit exceeding threads before reloading')
+ dumpstacks(thread_idents=[thread.ident for thread in self.limits_reached_threads])
self.reload()
# `reload` increments `self.quit_signals_received`
# and the loop will end after this iteration,
@@ -709,7 +711,7 @@ class PreforkServer(CommonServer):
raise KeyboardInterrupt
elif sig == signal.SIGQUIT:
# dump stacks on kill -3
- self.dumpstacks()
+ dumpstacks()
elif sig == signal.SIGUSR1:
# log ormcache stats on kill -SIGUSR1
log_ormcache_stats()