issue #201: parent: log a warning and work around race for now.
This commit is contained in:
parent
9fe14e841c
commit
cbe6be449e
|
@ -26,6 +26,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
import errno
|
||||||
import fcntl
|
import fcntl
|
||||||
import getpass
|
import getpass
|
||||||
import inspect
|
import inspect
|
||||||
|
@ -593,7 +594,15 @@ class Stream(mitogen.core.Stream):
|
||||||
# on_disconnect() call.
|
# on_disconnect() call.
|
||||||
return
|
return
|
||||||
|
|
||||||
pid, status = os.waitpid(self.pid, os.WNOHANG)
|
try:
|
||||||
|
pid, status = os.waitpid(self.pid, os.WNOHANG)
|
||||||
|
except OSError:
|
||||||
|
e = sys.exc_info()[1]
|
||||||
|
if e.args[0] == errno.ECHILD:
|
||||||
|
LOG.warn('%r: waitpid(%r) produced ECHILD', self.pid, self)
|
||||||
|
return
|
||||||
|
raise
|
||||||
|
|
||||||
if pid:
|
if pid:
|
||||||
LOG.debug('%r: child process exit status was %d', self, status)
|
LOG.debug('%r: child process exit status was %d', self, status)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue