Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7aaa1ef8
Kaydet (Commit)
7aaa1ef8
authored
Şub 26, 2013
tarafından
Richard Oudkerk
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR.
üst
8fd36697
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
6 deletions
+46
-6
forking.py
Lib/multiprocessing/forking.py
+12
-6
test_multiprocessing.py
Lib/test/test_multiprocessing.py
+32
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/multiprocessing/forking.py
Dosyayı görüntüle @
7aaa1ef8
...
...
@@ -35,6 +35,7 @@
import
os
import
sys
import
signal
import
errno
from
multiprocessing
import
util
,
process
...
...
@@ -128,12 +129,17 @@ if sys.platform != 'win32':
def
poll
(
self
,
flag
=
os
.
WNOHANG
):
if
self
.
returncode
is
None
:
try
:
pid
,
sts
=
os
.
waitpid
(
self
.
pid
,
flag
)
except
os
.
error
:
# Child process not yet created. See #1731717
# e.errno == errno.ECHILD == 10
return
None
while
True
:
try
:
pid
,
sts
=
os
.
waitpid
(
self
.
pid
,
flag
)
except
os
.
error
as
e
:
if
e
.
errno
==
errno
.
EINTR
:
continue
# Child process not yet created. See #1731717
# e.errno == errno.ECHILD == 10
return
None
else
:
break
if
pid
==
self
.
pid
:
if
os
.
WIFSIGNALED
(
sts
):
self
.
returncode
=
-
os
.
WTERMSIG
(
sts
)
...
...
Lib/test/test_multiprocessing.py
Dosyayı görüntüle @
7aaa1ef8
...
...
@@ -2167,6 +2167,38 @@ class _TestLogging(BaseTestCase):
# logger.warn('foo')
# assert self.__handled
#
# Check that Process.join() retries if os.waitpid() fails with EINTR
#
class
_TestPollEintr
(
BaseTestCase
):
ALLOWED_TYPES
=
(
'processes'
,)
@classmethod
def
_killer
(
cls
,
pid
):
time
.
sleep
(
0.5
)
os
.
kill
(
pid
,
signal
.
SIGUSR1
)
@unittest.skipUnless
(
hasattr
(
signal
,
'SIGUSR1'
),
'requires SIGUSR1'
)
def
test_poll_eintr
(
self
):
got_signal
=
[
False
]
def
record
(
*
args
):
got_signal
[
0
]
=
True
pid
=
os
.
getpid
()
oldhandler
=
signal
.
signal
(
signal
.
SIGUSR1
,
record
)
try
:
killer
=
self
.
Process
(
target
=
self
.
_killer
,
args
=
(
pid
,))
killer
.
start
()
p
=
self
.
Process
(
target
=
time
.
sleep
,
args
=
(
1
,))
p
.
start
()
p
.
join
()
self
.
assertTrue
(
got_signal
[
0
])
self
.
assertEqual
(
p
.
exitcode
,
0
)
killer
.
join
()
finally
:
signal
.
signal
(
signal
.
SIGUSR1
,
oldhandler
)
#
# Test to verify handle verification, see issue 3321
#
...
...
Misc/NEWS
Dosyayı görüntüle @
7aaa1ef8
...
...
@@ -230,6 +230,8 @@ Core and Builtins
Library
-------
- Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR.
- Issue #14720: sqlite3: Convert datetime microseconds correctly.
Patch by Lowe Thiderman.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment