Skip to content

server: ensure clean exit after proxy socket lost

Ryan Neph requested to merge ryanneph/virglrenderer:fix-reap-workers into master

When server detects proxy socket lost, it kills all workers, and expects render_worker_jail_wait_workers() to reap render_worker instances one-by-one.

Instead, waitid() produces errno == ECHILD and the server enters an infinite busy-loop with worker_count > 0, but never returning a worker to be reaped. This happens because the vtest server chooses to ignore SIGCHLD and that is wrongfully inherited by virgl_render_server.

This failure condition can be triggered by:

  1. running vtest in forking mode (default), built with -Drender-server-worker=process
  2. starting VK_ICD_FILENAMES=<prefix>/share/vulkan/icd.d/virtio_icd.x86_64.json VN_DEBUG=vtest vkcube
  3. then sending SIGINT (ctrl-c) or SIGKILL to the forked virgl_test_server process, leaving the main vtest server running.

Signed-off-by: Ryan Neph ryanneph@google.com

Edited by Ryan Neph

Merge request reports

Loading