Subject: bug#50849: 28.0.50; Proposal for Emacs daemon to signal when being busy

From: Eli Zaretskii <[email-masked]>
Date: Fri, 02 Sep 2022 14:21:30 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Fri, 02 Sep 2022 13:09:14 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > There is a (built-in) timeout, but it's way too long AFAIK.  And we
> > don't handle it any different from any other error: we exit.
> 
> Doing some testing, it seems to hang here in that recv:
> 
>   /* Now, wait for an answer and print any messages.  */
>   while (exit_status == EXIT_SUCCESS)
>     {
>       do
> 	{
> 	  act_on_signals (emacs_socket);
> 	  rl = recv (emacs_socket, string, BUFSIZ, 0);
> 	}
>       while (rl < 0 && errno == EINTR);
> 
> Does the recv time out?

Looks like it doesn't by default, but we can ask it to do so.  See,
for example,
https://stackoverflow.com/questions/30395258/setting-timeout-to-recv-function.