cloudflare / lua-resty-logger-socket

Raw-socket-based Logger Library for Nginx (based on ngx_lua)
488 stars 130 forks source link

why lua-ngx delete the unix domain socket file when it connects to server? #27

Closed enson69 closed 7 years ago

enson69 commented 7 years ago

We are using unix domain socket to connect to sever in my project, When testing, i found the unix domain socket file(which generated by server when server listen) was deleted every time ngx.socket.tcp calling connect. As i check the sourcecode, I found below in the function ngx_parse_unix_domain_url. / delete domain socket file. / ngx_delete_file(saun->sun_path); it seems ngx.socket.tcp would delete socket file every time it connect, and it would cause connect failure with err of "unix:/home/nginx/nginx/server.sock failed (2: No such file or directory)".

so my question is why it delete the socket file?
anybody knows? pls suggest.

enson69 commented 7 years ago

sorry, it is my teammate add the sentence.