Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bb574ffd
Commit
bb574ffd
authored
Mar 06, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22853: Fixed a deadlock when use multiprocessing.Queue at import time.
Patch by Florian Finkernagel and Davin Potts.
parent
3908d7de
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
6 deletions
+29
-6
Lib/multiprocessing/queues.py
Lib/multiprocessing/queues.py
+4
-6
Lib/test/test_multiprocessing.py
Lib/test/test_multiprocessing.py
+20
-0
Misc/ACKS
Misc/ACKS
+2
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/multiprocessing/queues.py
View file @
bb574ffd
...
@@ -44,10 +44,10 @@ import weakref
...
@@ -44,10 +44,10 @@ import weakref
from
Queue
import
Empty
,
Full
from
Queue
import
Empty
,
Full
import
_multiprocessing
import
_multiprocessing
from
multiprocessing
import
Pipe
from
.
import
Pipe
from
multiprocessing
.synchronize
import
Lock
,
BoundedSemaphore
,
Semaphore
,
Condition
from
.synchronize
import
Lock
,
BoundedSemaphore
,
Semaphore
,
Condition
from
multiprocessing.util
import
debug
,
info
,
Finalize
,
register_after_fork
from
.util
import
debug
,
info
,
Finalize
,
register_after_fork
,
is_exiting
from
multiprocessing
.forking
import
assert_spawning
from
.forking
import
assert_spawning
#
#
# Queue type using a pipe, buffer and thread
# Queue type using a pipe, buffer and thread
...
@@ -229,8 +229,6 @@ class Queue(object):
...
@@ -229,8 +229,6 @@ class Queue(object):
@
staticmethod
@
staticmethod
def
_feed
(
buffer
,
notempty
,
send
,
writelock
,
close
):
def
_feed
(
buffer
,
notempty
,
send
,
writelock
,
close
):
debug
(
'starting thread to feed data to pipe'
)
debug
(
'starting thread to feed data to pipe'
)
from
.util
import
is_exiting
nacquire
=
notempty
.
acquire
nacquire
=
notempty
.
acquire
nrelease
=
notempty
.
release
nrelease
=
notempty
.
release
nwait
=
notempty
.
wait
nwait
=
notempty
.
wait
...
...
Lib/test/test_multiprocessing.py
View file @
bb574ffd
...
@@ -620,6 +620,26 @@ class _TestQueue(BaseTestCase):
...
@@ -620,6 +620,26 @@ class _TestQueue(BaseTestCase):
for
p
in
workers
:
for
p
in
workers
:
p
.
join
()
p
.
join
()
def
test_no_import_lock_contention
(
self
):
with
test_support
.
temp_cwd
():
module_name
=
'imported_by_an_imported_module'
with
open
(
module_name
+
'.py'
,
'w'
)
as
f
:
f
.
write
(
"""if 1:
import multiprocessing
q = multiprocessing.Queue()
q.put('knock knock')
q.get(timeout=3)
q.close()
"""
)
with
test_support
.
DirsOnSysPath
(
os
.
getcwd
()):
try
:
__import__
(
module_name
)
except
Queue
.
Empty
:
self
.
fail
(
"Probable regression on import lock contention;"
" see Issue #22853"
)
#
#
#
#
#
#
...
...
Misc/ACKS
View file @
bb574ffd
...
@@ -411,6 +411,7 @@ Vincent Fiack
...
@@ -411,6 +411,7 @@ Vincent Fiack
Anastasia Filatova
Anastasia Filatova
Tomer Filiba
Tomer Filiba
Jeffrey Finkelstein
Jeffrey Finkelstein
Florian Finkernagel
Russell Finn
Russell Finn
Dan Finnie
Dan Finnie
Nils Fischbeck
Nils Fischbeck
...
@@ -1073,6 +1074,7 @@ Martin Pool
...
@@ -1073,6 +1074,7 @@ Martin Pool
Iustin Pop
Iustin Pop
Claudiu Popa
Claudiu Popa
John Popplewell
John Popplewell
Davin Potts
Guillaume Pratte
Guillaume Pratte
Amrit Prem
Amrit Prem
Paul Prescod
Paul Prescod
...
...
Misc/NEWS
View file @
bb574ffd
...
@@ -18,6 +18,9 @@ Core and Builtins
...
@@ -18,6 +18,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22853: Fixed a deadlock when use multiprocessing.Queue at import time.
Patch by Florian Finkernagel and Davin Potts.
- Issue #23476: In the ssl module, enable OpenSSL'
s
X509_V_FLAG_TRUSTED_FIRST
- Issue #23476: In the ssl module, enable OpenSSL'
s
X509_V_FLAG_TRUSTED_FIRST
flag
on
certificate
stores
when
it
is
available
.
flag
on
certificate
stores
when
it
is
available
.
...
...
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