Skip to content
Snippets Groups Projects
  1. Oct 05, 2023
  2. Sep 13, 2023
  3. Aug 21, 2023
  4. Aug 02, 2023
    • Rob Mueller's avatar
      Handle EINTR when doing sysread calls · 401c19aa
      Rob Mueller authored
      Starman usually sets max_spare_servers to max_servers - 1, so in
      general Net::Server will not try and kill off spare servers.
      
      However if you explicitly set max_spare_servers lower, then
      Net::Server::PreFork will attempt to do it's usual process management
      in coordinate_children(), which may end up calling kill_n_children()
      if there's excess children. This will send a HUP signal to some
      child processes to ask them to exit.
      
      The code in Net::Server::PreFork tries to only do this for 'waiting'
      child processes, but notes this is racy. That should be fine, because
      the child should continue processing any request in progress, and then
      exit after finishing the request because done() will be true after
      run_client_connection() completes.
      
      However Starman doesn't currently check the result of sysread() calls
      for EINTR, so if it receives a HUP while processing a request, the
      sysread() call returns undef, which ends up propogating up as an
      error message "Read error: Interrupted system call".
      
      The correct solution here is to detect the EINTR response and redo
      the sysread() call to complete the entire request successfully,
      before the high layer exits the child.
      401c19aa
  5. Sep 16, 2022
  6. Sep 13, 2022
  7. Aug 26, 2022
  8. Aug 25, 2022
  9. Sep 02, 2021
  10. Feb 11, 2021
  11. Aug 18, 2020
  12. Feb 25, 2020
  13. Feb 24, 2020
  14. Feb 22, 2020
  15. Nov 14, 2019
  16. Oct 27, 2019
Loading