Hello!
On Fri, Aug 28, 2015 at 3:17 PM, Puneet Agarwal wrote:
> I am using ngx_openresty-1.7.7.2 to serve http requests, nginx is running
> with 24 worker processes. I am trying to use vowpal wabbit as library using
> lua C interface. So the scenario is, http requests are received on nginx,
> content_by_lua directive calls lua code, and that lua code calls vowpal
> wabbits, VW_ReadExampleA and VW_Predict API's using lua's C interface. So,
> normally everything works well. But when we do "nginx -s reload", sometimes
> the call to VW library gets stuck and never returns, because of which the
> process which was supposed to shut down after reload doesn't shutdown.
> Because of this there are lots of idle worker processes in the system and
> the memory footprint is increasing. Can somebody throw some light, what can
> be causing this?
Seems like you're loading your C library in init_by_lua (i.e., within
the nginx master process during configuration loading) and your C
library does not support overlapped reloading.
You can try loading your C library in the worker processes instead.
Well, there might be deeper issues in your C library or your own C
binding. You'd better use tools like Valgrind or Address Sanitizer to
debug it.
>
> Also, when I attach starce to the process which is stuck, I get this
> futex(0x8f4b5c, FUTEX_WAIT_PRIVATE, 1, NULL
>
This is user-space locking. Maybe some of your C code involved enters
a deadlock? You can try tools like gdb and pstack to fetch the
userspace backtrace to get more context for the hang.
Well, just my 2 cents.
Regards,
-agentzh