Issue 36368: server process of shared_memory shuts down if KeyboardInterrupt
Created on 2019-03-19 16:38 by pierreglaser, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 0001-FIX-protect-shared_memory-server-from-SIGINT.patch | pierreglaser, 2019-03-19 16:38 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12483 | merged | pierreglaser, 2019-03-21 15:10 | |
| Messages (5) | |||
|---|---|---|---|
| msg338380 - (view) | Author: Pierre Glaser (pierreglaser) * | Date: 2019-03-19 16:38 | |
When starting a SharedMemoryManager in an interactive session, any KeyboardInterrupt event will be transmitted to the (sub)process running the shared memory server, which causes the Manager to be unusable thereafter: >>> from multiprocessing.managers import SharedMemoryManager >>> smm = SharedMemoryManager() >>> smm.start() >>> start typing something wrong KeyboardInterrupt >>> sl = smm.ShareableList(range(10)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/pierreglaser/repos/cpython/Lib/multiprocessing/managers.py", line 1342, in ShareableList with self._Client(self._address, authkey=self._authkey) as conn: File "/home/pierreglaser/repos/cpython/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/pierreglaser/repos/cpython/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) FileNotFoundError: [Errno 2] No such file or directory I suggest ignoring SIGINT in the server process. |
|||
| msg338488 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2019-03-20 15:57 | |
Your patch sounds good on the principle, but can you make a patch out of it? |
|||
| msg338489 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2019-03-20 15:58 | |
Sorry - I meant make a *PR* out of it :-) |
|||
| msg338548 - (view) | Author: Pierre Glaser (pierreglaser) * | Date: 2019-03-21 15:12 | |
Done. |
|||
| msg342117 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2019-05-10 18:42 | |
New changeset d0d64ad1f5f1dc1630004091d7f8209546c1220a by Antoine Pitrou (Pierre Glaser) in branch 'master': bpo-36368: Ignore SIGINT in SharedMemoryManager servers. (GH-12483) https://github.com/python/cpython/commit/d0d64ad1f5f1dc1630004091d7f8209546c1220a |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:12 | admin | set | github: 80549 |
| 2019-05-18 12:38:22 | pierreglaser | set | status: open -> closed stage: patch review -> resolved |
| 2019-05-10 18:42:39 | pitrou | set | messages: + msg342117 |
| 2019-03-21 15:12:09 | pierreglaser | set | messages: + msg338548 |
| 2019-03-21 15:10:56 | pierreglaser | set | stage: patch review pull_requests: + pull_request12436 |
| 2019-03-20 15:58:13 | pitrou | set | messages: + msg338489 |
| 2019-03-20 15:57:51 | pitrou | set | messages: + msg338488 |
| 2019-03-19 16:38:01 | pierreglaser | create | |
