Better error logging from prewarm zygote
This commit is contained in:
parent
5098792723
commit
360ff35061
1 changed files with 8 additions and 1 deletions
|
|
@ -38,6 +38,10 @@
|
|||
TIMEOUT = 15.0 if os.environ.get('CI') == 'true' else 5.0
|
||||
|
||||
|
||||
def print_error(*a: Any) -> None:
|
||||
log_error('Prewarm zygote:', *a)
|
||||
|
||||
|
||||
class PrewarmProcessFailed(Exception):
|
||||
pass
|
||||
|
||||
|
|
@ -496,7 +500,8 @@ def check_event(event: int, err_msg: str) -> None:
|
|||
if event & select.POLLHUP:
|
||||
raise SystemExit(0)
|
||||
if event & error_events:
|
||||
raise SystemExit(f'Prewarm zygote process: {err_msg}')
|
||||
print_error(err_msg)
|
||||
raise SystemExit(1)
|
||||
|
||||
def handle_input(event: int) -> None:
|
||||
nonlocal input_buf, output_buf
|
||||
|
|
@ -629,6 +634,8 @@ def handle_socket_client(event: int) -> None:
|
|||
scq.child_id = next(child_id_counter)
|
||||
except SocketClosed:
|
||||
socket_children.pop(q)
|
||||
except OSError as e:
|
||||
print_error(f'Failed to fork socket child with error: {e}')
|
||||
continue
|
||||
if event & error_events:
|
||||
socket_children.pop(q)
|
||||
|
|
|
|||
Loading…
Reference in a new issue