diff options
| author | Xavier Morel <xmo@odoo.com> | 2019-10-24 13:08:01 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-11-04 11:35:59 +0000 |
| commit | 79313d8817d72f52df313d53ba121efe98c97379 (patch) | |
| tree | a0bfd6ea1b40fb15bdfe1f5db5621d0ef6d5dc4a /doc/reference/javascript_reference.rst | |
| parent | 92c40caccdba5a08815fb24ab467bce971553053 (diff) | |
[FIX] core: SIGXCPU in worker processes
odoo/odoo#30688 (6ce2d6efb5b53451f369d544a31c36a024e0faf5) added an
indirection in prefork workers: Python-level signal handlers are
delayed until native calls have ended (e.g. accept() or
execute()). Running the actual work in a sub-thread allowed the main
thread to handle signals in all cases.
However there is apparently an issue with SIGXCPU on linux (possibly
other cases as well): SIGXCPU is delivered to the child thread (if
possible?) and Thread.join apparently stops it from redelivered to
the main thread (Thread.join is signal-interruptible since 3.2 but
possibly not Python-interruptible).
Blocking SIGXCPU on the child thread causes the OS to deliver on the
main thread and fixes the issue.
Also split set_limits so it sets the signal handler in the parent
thread but properly updates the soft limit in the child after each
request, as the goal is to put a hard limit on the CPU time per
request, not on the worker. 6ce2d6ef would set the limit once then
never update it, likely cycling workers more than desired.
While at it:
* block other signals with a handler set, they seem to work
regardless on linux but other OS may have a different way of
dispatching process-directed signals
* unset signals which are set by the prefork server but whose
set behavior makes no sense in workers:
- TERM and CHLD were already unset
- HUP is used to restart the server, workers can just be killed
- TTIN and TTOU configure the number of workers
closes odoo/odoo#39731
X-original-commit: 549bd199bad269e4e28efac933efac3f41495877
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
