[noPoll] nopoll_loop_wait(ctx,0) unexpectedly exited

Francis Brosnan Blázquez francis.brosnan en aspl.es
Mar Sep 19 13:41:27 CEST 2017


Hello Tony.

> OK, looking in the code for nopoll_loop_wait(), it appears the only
> two ways
> the loop can exit are:
> - ctx->keep_looping cets cleared. This only happens in
> nopoll_loop_stop()
> - the wait operation exits with -1 for some reason


That's right.


> I didn't have nopoll logging enabled, so can't tell if it was the
> second.


Ok.


> It looks like I could recover from the latter situation with the
> kludge:
> 
>   do {
>     nopoll_loop_wait(ctx,0);
>   } while(ctx->keep_looping);
> 
> That would re-invoke it if it had exited abnormally due to a wait
> error.


That would do in essense. To complete this, I've updated
nopoll_loop_wait code to report -3 for timeout errors and -4 for I/O
wait engine errors.

https://github.com/ASPLes/nopoll/commit/41d06366b1f814a32feff58ef2d4906a25b3a37e

This way you can extend your solution to only keep on looping on this
condition.

https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L214

Best Regards.


> Cheers
> Tony


------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.aspl.es/pipermail/nopoll/attachments/20170919/f965f6d2/attachment.html>


Más información sobre la lista de distribución noPoll