# HG changeset patch # User Marcin Kuzminski # Date 2018-02-01 16:25:48 # Node ID 12f7a3616721a6ba39e042cbf15448f1dc5c6ae5 # Parent 305b33c6dd9c8e57a47bb2c85ee759912226dfc7 subprocessio: instead of raising a Thread error we sent a signal to gunicorn. This will cause a worker recycle, and not block itself anymore. diff --git a/vcsserver/subprocessio.py b/vcsserver/subprocessio.py --- a/vcsserver/subprocessio.py +++ b/vcsserver/subprocessio.py @@ -23,10 +23,13 @@ along with git_http_backend.py Project. If not, see . """ import os +import logging import subprocess32 as subprocess from collections import deque from threading import Event, Thread +log = logging.getLogger(__name__) + class StreamFeeder(Thread): """ @@ -133,8 +136,9 @@ class InputStreamChunker(Thread): keep_reading.clear() keep_reading.wait(timeout_input) if len(t) > chunk_count_max + timeout_input: - raise IOError( - "Timed out while waiting for input from subprocess.") + log.error("Timed out while waiting for input from subprocess.") + os._exit(-1) # this will cause the worker to recycle itself + t.append(b) da.set() b = s.read(cs)