[issue44462] multiprocessing.get hangs if the pool is closed in the signal handler

2021-06-19 Thread Chaitanya


New submission from Chaitanya :

This is similar to https://bugs.python.org/issue22393 but the child is killed 
in the Pool.terminate() using SIGTERM i.e., proper way.

Run the attached script that runs an indefinite method using 
multiprocessing.apply_async, and in the signal handler for SIGTERM does the 
pool clean up (close, terminate and join), on issuing a SIGTERM (`kill `), the cleanup works fine, but the parent process is stuck in get() as 
during termination the event is not set.

Able to repro with all 3.6/3.9/3.10.


See logs below
```
[DEBUG/MainProcess] created semlock with handle 140035884298240
[DEBUG/MainProcess] created semlock with handle 140035884294144
[DEBUG/MainProcess] created semlock with handle 140035884290048
[DEBUG/MainProcess] created semlock with handle 140035884285952
[DEBUG/MainProcess] created semlock with handle 140035884281856
[DEBUG/MainProcess] created semlock with handle 140035884277760
[DEBUG/MainProcess] added worker
[INFO/ForkPoolWorker-1] child process calling self.run()
[INFO/MainProcess] 
[INFO/MainProcess] 
[INFO/MainProcess] 
[INFO/ForkPoolWorker-1] Signals for 28462
[INFO/ForkPoolWorker-1] Handlers.SIG_DFL
[INFO/ForkPoolWorker-1] 
[INFO/ForkPoolWorker-1] Handlers.SIG_DFL
[INFO/MainProcess] 28461: Caught signal 15
[INFO/MainProcess] 28461: Closing pools
[INFO/MainProcess] 28461: Terminating pools
[DEBUG/MainProcess] terminating pool
[DEBUG/MainProcess] finalizing pool
[DEBUG/MainProcess] helping task handler/workers to finish
[DEBUG/MainProcess] removing tasks from inqueue until task handler finished
[DEBUG/MainProcess] joining worker handler
[DEBUG/MainProcess] worker handler exiting
[DEBUG/MainProcess] result handler found thread._state=TERMINATE
[DEBUG/MainProcess] ensuring that outqueue is not full
[DEBUG/MainProcess] result handler exiting: len(cache)=1, 
thread._state=TERMINATE
[DEBUG/MainProcess] task handler got sentinel
[DEBUG/MainProcess] task handler sending sentinel to result handler
[DEBUG/MainProcess] task handler sending sentinel to workers
[DEBUG/MainProcess] task handler exiting
[DEBUG/MainProcess] terminating workers
[DEBUG/MainProcess] joining task handler
[DEBUG/MainProcess] joining result handler
[DEBUG/MainProcess] joining pool workers
[DEBUG/MainProcess] cleaning up worker 28462
[INFO/MainProcess] 28461: Joining pools
[DEBUG/MainProcess] joining pool
[INFO/MainProcess] 28461: Closed pools
```

```
(gdb) py-bt
Traceback (most recent call first):
  File "/usr/lib/python3.9/threading.py", line 312, in wait
waiter.acquire()
  File "/usr/lib/python3.9/threading.py", line 574, in wait
signaled = self._cond.wait(timeout)
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 762, in wait
self._event.wait(timeout)
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 765, in get
self.wait(timeout)
  File "/home/tatac/workspaces/gerrit/bwt-device-health-manager/mp_test.py", 
line 66, in 
a.get()
(gdb) 
```

--
components: Library (Lib)
files: mp_test.py
messages: 396151
nosy: tkc17
priority: normal
severity: normal
status: open
title: multiprocessing.get hangs if the pool is closed in the signal handler
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50121/mp_test.py

___
Python tracker 
<https://bugs.python.org/issue44462>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22918] Doc for __iter__ makes inexact comment about dict.__iter__

2014-12-10 Thread Chaitanya agrawal

Changes by Chaitanya agrawal :


--
keywords: +patch
Added file: http://bugs.python.org/file37407/issue22918-inexactComment.diff

___
Python tracker 
<http://bugs.python.org/issue22918>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22883] Get rid of references to PyInt in Py3 sources

2014-12-10 Thread Chaitanya agrawal

Changes by Chaitanya agrawal :


--
keywords: +patch
Added file: http://bugs.python.org/file37408/issue22883.patch

___
Python tracker 
<http://bugs.python.org/issue22883>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22883] Get rid of references to PyInt in Py3 sources

2014-12-11 Thread Chaitanya agrawal

Changes by Chaitanya agrawal :


Added file: http://bugs.python.org/file37417/issue228813_msg232419.patch

___
Python tracker 
<http://bugs.python.org/issue22883>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22883] Get rid of references to PyInt in Py3 sources

2014-12-11 Thread Chaitanya agrawal

Changes by Chaitanya agrawal :


Removed file: http://bugs.python.org/file37417/issue228813_msg232419.patch

___
Python tracker 
<http://bugs.python.org/issue22883>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22883] Get rid of references to PyInt in Py3 sources

2014-12-11 Thread Chaitanya agrawal

Changes by Chaitanya agrawal :


Added file: http://bugs.python.org/file37417/issue228813_msg232419.patch

___
Python tracker 
<http://bugs.python.org/issue22883>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23047] typo in pyporting.rst

2014-12-13 Thread Chaitanya agrawal

Chaitanya agrawal added the comment:

Typo corrected according to message232600.

--
keywords: +patch
nosy: +krypten
Added file: http://bugs.python.org/file37438/issue23047.patch

___
Python tracker 
<http://bugs.python.org/issue23047>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23041] csv needs more quoting rules

2014-12-13 Thread Chaitanya agrawal

Chaitanya agrawal added the comment:

Used function PyUnicode_Check instead of PyString_Check

--
keywords: +patch
nosy: +krypten
Added file: http://bugs.python.org/file37444/issue23041.patch

___
Python tracker 
<http://bugs.python.org/issue23041>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23041] csv needs more quoting rules

2014-12-13 Thread Chaitanya agrawal

Changes by Chaitanya agrawal :


Added file: http://bugs.python.org/file37445/issue23041_test.patch

___
Python tracker 
<http://bugs.python.org/issue23041>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26176] EmailMessage example doesn't work

2016-01-21 Thread Srujan Chaitanya

New submission from Srujan Chaitanya:

Example provided in 19.1.14.1. Examples using the Provisional API
at 
https://docs.python.org/3.4/library/email-examples.html?highlight=email%20example

Doesn't work. This could be a EmailMessage class issue also?

--
assignee: docs@python
components: Documentation
messages: 258781
nosy: Srujan Chaitanya, docs@python
priority: normal
severity: normal
status: open
title: EmailMessage example doesn't work
type: behavior
versions: Python 3.4

___
Python tracker 
<http://bugs.python.org/issue26176>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26429] os.path.dirname returns empty string instead of "." when file is in current directory

2016-02-24 Thread Chaitanya Mannem

New submission from Chaitanya Mannem:

Don't know if this is for windows compatibility or whatever but I think it 
makes more sense if os.path.dirname would return "." if the file passed in was 
in the current directory.

--
components: Library (Lib)
messages: 260821
nosy: Chaitanya Mannem
priority: normal
severity: normal
status: open
title: os.path.dirname returns empty string instead of "." when file is in 
current directory
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 
<http://bugs.python.org/issue26429>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com