[issue6362] multiprocessing: handling of errno after signals in sem_acquire()

Tumer Topcu report at bugs.python.org
Sun Jun 22 17:56:54 CEST 2014


Tumer Topcu added the comment:

Looks like the suggested fix is there in v2.7.6:

do {
        Py_BEGIN_ALLOW_THREADS
        if (blocking && timeout_obj == Py_None)
            res = sem_wait(self->handle);
        else if (!blocking)
            res = sem_trywait(self->handle);
        else
            res = sem_timedwait(self->handle, &deadline);
        Py_END_ALLOW_THREADS
        err = errno;
        if (res == MP_EXCEPTION_HAS_BEEN_SET)
            break;
    } while (res < 0 && errno == EINTR && !PyErr_CheckSignals());

    if (res < 0) {
        errno = err;
        if (errno == EAGAIN || errno == ETIMEDOUT)
            Py_RETURN_FALSE;
        else if (errno == EINTR)
            return NULL;
        else
            return PyErr_SetFromErrno(PyExc_OSError);
    }


But I am still able to reproduce the issue following the exact same steps written.

----------
nosy: +trent, tumert

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6362>
_______________________________________


More information about the Python-bugs-list mailing list