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
e2f33add
Kaydet (Commit)
e2f33add
authored
Mar 21, 2018
tarafından
Thomas Moreau
Kaydeden (comit)
Antoine Pitrou
Mar 21, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33078 - Fix queue size on pickling error (GH-6119)
üst
9308dea3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
queues.py
Lib/multiprocessing/queues.py
+8
-2
_test_multiprocessing.py
Lib/test/_test_multiprocessing.py
+13
-0
2018-03-15-07-38-00.bpo-33078.RmjUF5.rst
...S.d/next/Library/2018-03-15-07-38-00.bpo-33078.RmjUF5.rst
+2
-0
No files found.
Lib/multiprocessing/queues.py
Dosyayı görüntüle @
e2f33add
...
...
@@ -161,7 +161,7 @@ class Queue(object):
target
=
Queue
.
_feed
,
args
=
(
self
.
_buffer
,
self
.
_notempty
,
self
.
_send_bytes
,
self
.
_wlock
,
self
.
_writer
.
close
,
self
.
_ignore_epipe
,
self
.
_on_queue_feeder_error
),
self
.
_on_queue_feeder_error
,
self
.
_sem
),
name
=
'QueueFeederThread'
)
self
.
_thread
.
daemon
=
True
...
...
@@ -203,7 +203,7 @@ class Queue(object):
@staticmethod
def
_feed
(
buffer
,
notempty
,
send_bytes
,
writelock
,
close
,
ignore_epipe
,
onerror
):
onerror
,
queue_sem
):
debug
(
'starting thread to feed data to pipe'
)
nacquire
=
notempty
.
acquire
nrelease
=
notempty
.
release
...
...
@@ -255,6 +255,12 @@ class Queue(object):
info
(
'error in queue thread:
%
s'
,
e
)
return
else
:
# Since the object has not been sent in the queue, we need
# to decrease the size of the queue. The error acts as
# if the object had been silently removed from the queue
# and this step is necessary to have a properly working
# queue.
queue_sem
.
release
()
onerror
(
e
,
obj
)
@staticmethod
...
...
Lib/test/_test_multiprocessing.py
Dosyayı görüntüle @
e2f33add
...
...
@@ -1056,6 +1056,19 @@ class _TestQueue(BaseTestCase):
self
.
assertTrue
(
q
.
get
(
timeout
=
1.0
))
close_queue
(
q
)
with
test
.
support
.
captured_stderr
():
# bpo-33078: verify that the queue size is correctly handled
# on errors.
q
=
self
.
Queue
(
maxsize
=
1
)
q
.
put
(
NotSerializable
())
q
.
put
(
True
)
self
.
assertEqual
(
q
.
qsize
(),
1
)
# bpo-30595: use a timeout of 1 second for slow buildbots
self
.
assertTrue
(
q
.
get
(
timeout
=
1.0
))
# Check that the size of the queue is correct
self
.
assertEqual
(
q
.
qsize
(),
0
)
close_queue
(
q
)
def
test_queue_feeder_on_queue_feeder_error
(
self
):
# bpo-30006: verify feeder handles exceptions using the
# _on_queue_feeder_error hook.
...
...
Misc/NEWS.d/next/Library/2018-03-15-07-38-00.bpo-33078.RmjUF5.rst
0 → 100644
Dosyayı görüntüle @
e2f33add
Fix the size handling in multiprocessing.Queue when a pickling error
occurs.
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