[noPoll] nopoll_loop_wait(ctx,0) unexpectedly exited

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


Hello Tony.

I've been reviewing this and the only way for nopoll_loop_wait to
stop/return is to have an error at:

https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L237
(ctx->io_engine->wait returning error)

...or timeout reached (which is not your case):

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

So, I think there must have been some error while waiting (because some
socket was in a non-consistent state or something..). I assume you
don't the log reporting such failure so we can better know error
reported, right?:


        https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L238
        
        nopoll_log (ctx, NOPOLL_LEVEL_CRITICAL, "Received error from
        wait operation, error code was: %d", errno);
        

Anyway, reviewing this case I think it would be useful to have
nopoll_loop_wait to report an error code that indicates these failures
so you can react by calling nopoll_loop_init code in case of ->wait
failure to recover. I'm going to review this.

Best Regards.


El mar, 19-09-2017 a las 10:51 +0000, Tony Mountifield escribió:

> I just had a strange occurrence, and wondered how to go about understanding it.
> 
> I have a websocket thread that calls nopoll_loop_wait(ctx,0), which I expected
> to continue running until another thread calls nopoll_loop_stop(ctx) as part
> of the process termination.
> 
> Today, while testing, nopoll_look_wait() had been running fine, but then exited
> when I closed one of the accepted connections. I hadn't captured the return status,
> but will add code to do that for next time.
> 
> I am certain nopoll_loop_stop() had not been called, so I was wondering if there
> is any other reason nopoll_loop_wait(ctx,0) would exit after running fine for a time?
> 
> I've only ever seen it happen the once.
> 
> I'll dig into the code, but wanted to ask here for ideas!
> 
> Thanks,
> Tony


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


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