[Openais] PATCH: poll problem

Steven Dake sdake at redhat.com
Thu Aug 24 07:10:17 PDT 2006


On Thu, 2006-08-24 at 14:50 +0200, Fabien THOMAS wrote:
> in ipc.c i dont understand why the code ignore EAGAIN:
> 
>         res = recvmsg (conn_info->fd, &msg_recv, MSG_NOSIGNAL);
>          if (res == -1 && errno == EINTR) {
>                  goto retry_recv;
>          } else
>          if (res == -1 && errno != EAGAIN) {
>                  return;
>          } else
>          if (res == 0) {
>                  return;
>          }
> 
> ...
> why not this:
> 
>         res = recvmsg (conn_info->fd, &msg_recv, MSG_NOSIGNAL);
>          if (res == -1) {
> 		if (errno == EINTR || errno == EAGAIN)
> 	                goto retry_recv;
> 		return;
>          } else
>          if (res == 0) {
>                  return;
>          }
> ...
> 

Fabien,

IPC in the aisexec should never block which the proposed change would
do.  If EAGAIN is returned, the IPC layer will execute poll again
(rapidly) and pick up the read when the client is able to read.

Is this the cause of the ipc lockup you see?  There could be potentially
some other problem here.

Since IPC has been rewritten several times and most recently for
threaded behavior, its possible there is a bug, but the above is by
design.  We should fix the bug and avoid blocking.

Regards
-steve

> Le 24 août 06 à 14:33, Fabien THOMAS a écrit :
> 
> > POLLHUP and POLLERR is completly broken on many BSD OS.
> > Even if the manpage say that it can return it the kernel does not  
> > handle this case...
> >
> > I've also added a missing close of a fd on error case.
> >
> > Any comment on the patch ?
> >
> > Fabien
> >
> >
> > <patch-poll>
> > _______________________________________________
> > Openais mailing list
> > Openais at lists.osdl.org
> > https://lists.osdl.org/mailman/listinfo/openais
> 
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/openais




More information about the Openais mailing list