[noPoll] nopoll_loop_wait(ctx,0) unexpectedly exited
Tony Mountifield
tony en softins.co.uk
Mar Sep 19 13:42:53 CEST 2017
Hi Francis,
Thanks for your quick reply. I didn’t have logging enabled, because it produces a lot of output!
If there was a way to enable logging only for messages over a certain level, that would be useful. I know I could write my own handler which could do the filtering. I may do that anyway.
Thanks
Tony
From: Francis Brosnan Blázquez [mailto:francis.brosnan at aspl.es]
Sent: 19 September 2017 12:24
To: Tony Mountifield
Cc: nopoll at lists.aspl.es
Subject: Re: [noPoll] nopoll_loop_wait(ctx,0) unexpectedly exited
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 <https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L238nopoll_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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aspl.es/pipermail/nopoll/attachments/20170919/ea144a7a/attachment-0001.html>
Más información sobre la lista de distribución noPoll