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
674a3cd2
Kaydet (Commit)
674a3cd2
authored
Şub 12, 2016
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24303: Fix random EEXIST upon multiprocessing semaphores creation with
Linux PID namespaces enabled.
üst
c665ff61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
NEWS
Misc/NEWS
+3
-0
semaphore.c
Modules/_multiprocessing/semaphore.c
+12
-4
No files found.
Misc/NEWS
Dosyayı görüntüle @
674a3cd2
...
@@ -50,6 +50,9 @@ Core and Builtins
...
@@ -50,6 +50,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
24303
:
Fix
random
EEXIST
upon
multiprocessing
semaphores
creation
with
Linux
PID
namespaces
enabled
.
-
Issue
#
25698
:
Importing
module
if
the
stack
is
too
deep
no
longer
replaces
-
Issue
#
25698
:
Importing
module
if
the
stack
is
too
deep
no
longer
replaces
imported
module
with
the
empty
one
.
imported
module
with
the
empty
one
.
...
...
Modules/_multiprocessing/semaphore.c
Dosyayı görüntüle @
674a3cd2
...
@@ -429,7 +429,7 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -429,7 +429,7 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
int
kind
,
maxvalue
,
value
;
int
kind
,
maxvalue
,
value
;
PyObject
*
result
;
PyObject
*
result
;
static
char
*
kwlist
[]
=
{
"kind"
,
"value"
,
"maxvalue"
,
NULL
};
static
char
*
kwlist
[]
=
{
"kind"
,
"value"
,
"maxvalue"
,
NULL
};
static
int
counter
=
0
;
int
try
=
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"iii"
,
kwlist
,
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"iii"
,
kwlist
,
&
kind
,
&
value
,
&
maxvalue
))
&
kind
,
&
value
,
&
maxvalue
))
...
@@ -440,10 +440,18 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -440,10 +440,18 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return
NULL
;
return
NULL
;
}
}
PyOS_snprintf
(
buffer
,
sizeof
(
buffer
),
"/mp%ld-%d"
,
(
long
)
getpid
(),
counter
++
);
/* Create a semaphore with a unique name. The bytes returned by
* _PyOS_URandom() are treated as unsigned long to ensure that the filename
* is valid (no special characters). */
do
{
unsigned
long
suffix
;
_PyOS_URandom
((
char
*
)
&
suffix
,
sizeof
(
suffix
));
PyOS_snprintf
(
buffer
,
sizeof
(
buffer
),
"/mp%ld-%lu"
,
(
long
)
getpid
(),
suffix
);
SEM_CLEAR_ERROR
();
handle
=
SEM_CREATE
(
buffer
,
value
,
maxvalue
);
}
while
((
handle
==
SEM_FAILED
)
&&
(
errno
==
EEXIST
)
&&
(
++
try
<
100
));
SEM_CLEAR_ERROR
();
handle
=
SEM_CREATE
(
buffer
,
value
,
maxvalue
);
/* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */
/* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */
if
(
handle
==
SEM_FAILED
||
SEM_GET_LAST_ERROR
()
!=
0
)
if
(
handle
==
SEM_FAILED
||
SEM_GET_LAST_ERROR
()
!=
0
)
goto
failure
;
goto
failure
;
...
...
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