[dm-devel] [PATCH 32/35] multipathd: uxlsnr: add timeout handling

Martin Wilck mwilck at suse.com
Thu Sep 16 08:58:36 UTC 2021


On Wed, 2021-09-15 at 23:17 -0500, Benjamin Marzinski wrote:
> On Fri, Sep 10, 2021 at 01:41:17PM +0200, mwilck at suse.com wrote:
> > From: Martin Wilck <mwilck at suse.com>
> > 
> > Our ppoll() call needs to wake up when a client request times out.
> > This logic can be added by determining the first client that's
> > about
> > to time out. The logic in handle_client() will then cause a timeout
> > reply to be sent to the client. This is more client-friendly
> > as the client timing out without receiving a reply.
> > 
> > Signed-off-by: Martin Wilck <mwilck at suse.com>
> > ---
> >  multipathd/uxlsnr.c | 58
> > +++++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 53 insertions(+), 5 deletions(-)
> > 
> >  
> > @@ -594,6 +643,7 @@ void *uxsock_listen(long ux_sock, void
> > *trigger_data)
> >         while (1) {
> >                 struct client *c, *tmp;
> >                 int i, n_pfds, poll_count, num_clients;
> > +               struct timespec __timeout, *timeout;
> 
> Maybe it's just too late to be looking at code, but I'm missing why
> we
> need a separate variable that it a pointer to __timeout.

This way __get_soonest_timeout() can return either NULL or &__timeout,
and we can simply pass the return value to ppoll().

Martin






More information about the dm-devel mailing list