This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2017年05月12日 22:30 by vstinner, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 7968 | merged | vstinner, 2018年06月27日 15:25 | |
| PR 7969 | merged | miss-islington, 2018年06月27日 16:19 | |
| PR 7970 | merged | miss-islington, 2018年06月27日 16:20 | |
| PR 16349 | merged | vstinner, 2019年09月24日 10:31 | |
| PR 16352 | merged | miss-islington, 2019年09月24日 12:20 | |
| PR 16353 | merged | miss-islington, 2019年09月24日 12:20 | |
| Messages (13) | |||
|---|---|---|---|
| msg293585 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年05月12日 22:30 | |
http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/601/steps/test/logs/stdio ====================================================================== FAIL: test_mymanager_context (test.test_multiprocessing_spawn.WithManagerTestMyManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea3円.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 2232, in test_mymanager_context self.assertEqual(manager._process.exitcode, 0) AssertionError: -15 != 0 ---------------------------------------------------------------------- Ran 277 tests in 667.577s FAILED (failures=1, skipped=24) test test_multiprocessing_spawn failed |
|||
| msg293717 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年05月15日 15:48 | |
> manager._process.exitcode == -15 -15 is -signal.SIGTERM and comes from Popen.wait() of multiprocessing.popen_spawn_win32. res = _winapi.WaitForSingleObject(int(self._handle), msecs) if res == _winapi.WAIT_OBJECT_0: code = _winapi.GetExitCodeProcess(self._handle) if code == TERMINATE: code = -signal.SIGTERM The process exited and its exit code is 0x10000 (TERMINATE). I understand that Popen.terminate() of multiprocessing.popen_spawn_win32 was called. BaseManager.start() registers a finalizer: _finalize_manager(). This method sends a "shutdown" message to the process and then gives 1.0 second to the process to complete. If the process doesn't complete in 1 second, .terminate() is called. 1 second is kind of arbitrary: it depends on the system load. We should give more time to the manager to complete, or accept -signal.SIGTERM as a "valid" exit code. I see different options: * Shutdown the manager in test_multiprocessing and give more time to the manager to complete * Make the timeout configurable * Allow -signal.SIGTERM exit code in test_mymanager_context() |
|||
| msg302470 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年09月18日 16:19 | |
Similar issue: bpo-31510. |
|||
| msg320592 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年06月27日 15:24 | |
The bug can easily be reproduced on Linux using this change: diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 04df26bac6..3d952407c2 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -649,7 +649,7 @@ class BaseManager(object): except Exception: pass - process.join(timeout=1.0) + process.join(timeout=0.0) if process.is_alive(): util.info('manager still alive') if hasattr(process, 'terminate'): |
|||
| msg320593 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年06月27日 15:28 | |
Python 2.7 terminates the manager process if it takes longer than 200 ms to stop (Python 3 uses a limit of 1 second), but test_multiprocessing doesn't test the exit code of the manager process and so Python 2.7 is not impacted by this bug. |
|||
| msg320594 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年06月27日 15:29 | |
> I see different options: (...) * Allow -signal.SIGTERM exit code in test_mymanager_context() When I discussed with Davin, he told me that it's an acceptable solution. So I wrote the PR 7968 to implement this trivial fix. |
|||
| msg320599 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年06月27日 16:18 | |
New changeset fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8 by Victor Stinner in branch 'master': bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968) https://github.com/python/cpython/commit/fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8 |
|||
| msg320600 - (view) | Author: miss-islington (miss-islington) | Date: 2018年06月27日 16:38 | |
New changeset 34f2935dca7bb20cd87e42dc41985cc3d688a735 by Miss Islington (bot) in branch '3.7': bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968) https://github.com/python/cpython/commit/34f2935dca7bb20cd87e42dc41985cc3d688a735 |
|||
| msg320602 - (view) | Author: miss-islington (miss-islington) | Date: 2018年06月27日 16:45 | |
New changeset a599323fc7661668a01e9fbb0d2369e62941bdf1 by Miss Islington (bot) in branch '3.6': bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968) https://github.com/python/cpython/commit/a599323fc7661668a01e9fbb0d2369e62941bdf1 |
|||
| msg320612 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年06月27日 20:25 | |
I fixed the test in 3.6, 3.7 and master branches. |
|||
| msg353081 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年09月24日 12:19 | |
New changeset b0e1ae5f5430433766e023c1a6936aeba0f2b84e by Victor Stinner in branch 'master': bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349) https://github.com/python/cpython/commit/b0e1ae5f5430433766e023c1a6936aeba0f2b84e |
|||
| msg353085 - (view) | Author: miss-islington (miss-islington) | Date: 2019年09月24日 12:38 | |
New changeset 46f6c566a888fb637913ef71fed28568180eafb4 by Miss Islington (bot) in branch '3.7': bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349) https://github.com/python/cpython/commit/46f6c566a888fb637913ef71fed28568180eafb4 |
|||
| msg353087 - (view) | Author: miss-islington (miss-islington) | Date: 2019年09月24日 12:40 | |
New changeset 081641fe520382d48ffead158ab528180f72017d by Miss Islington (bot) in branch '3.8': bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349) https://github.com/python/cpython/commit/081641fe520382d48ffead158ab528180f72017d |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:46 | admin | set | github: 74541 |
| 2019年09月24日 12:40:01 | miss-islington | set | messages: + msg353087 |
| 2019年09月24日 12:38:44 | miss-islington | set | messages: + msg353085 |
| 2019年09月24日 12:20:12 | miss-islington | set | pull_requests: + pull_request15933 |
| 2019年09月24日 12:20:00 | miss-islington | set | pull_requests: + pull_request15931 |
| 2019年09月24日 12:19:54 | vstinner | set | messages: + msg353081 |
| 2019年09月24日 10:31:18 | vstinner | set | pull_requests: + pull_request15927 |
| 2018年06月27日 20:25:47 | vstinner | set | status: open -> closed resolution: fixed messages: + msg320612 stage: patch review -> resolved |
| 2018年06月27日 16:45:04 | miss-islington | set | messages: + msg320602 |
| 2018年06月27日 16:38:39 | miss-islington | set | nosy:
+ miss-islington messages: + msg320600 |
| 2018年06月27日 16:20:21 | miss-islington | set | pull_requests: + pull_request7578 |
| 2018年06月27日 16:19:31 | miss-islington | set | pull_requests: + pull_request7577 |
| 2018年06月27日 16:18:20 | vstinner | set | messages: + msg320599 |
| 2018年06月27日 15:29:22 | vstinner | set | messages: + msg320594 |
| 2018年06月27日 15:28:07 | vstinner | set | messages:
+ msg320593 versions: + Python 3.6, Python 3.8 |
| 2018年06月27日 15:25:42 | vstinner | set | keywords:
+ patch stage: patch review pull_requests: + pull_request7576 |
| 2018年06月27日 15:24:11 | vstinner | set | messages: + msg320592 |
| 2017年09月18日 16:19:44 | vstinner | set | messages: + msg302470 |
| 2017年05月15日 15:48:38 | vstinner | set | messages: + msg293717 |
| 2017年05月12日 22:30:23 | vstinner | create | |