Hello!
On Fri, Jul 11, 2014 at 2:21 AM, santi kumar wrote:
> In our use case we are using lua-resty-upload for uploading files with
> nginx. When client goes offline in the middle of request, getting the below
> errors after timeout in the error logs.
> closed, client: xx.xx.xx.xx, server: localhost, request: "POST /upload/
> HTTP/1.1", host: “xxxxxxxxxx”
> client aborted, client: xx.xx.xx.xx, server: localhost, request: "POST
> /upload/ HTTP/1.1", host: “xxxxxxxxxx”
>
These error messages look like coming from your own Lua code (from the
ngx.log() line in your own Lua code snippet given).
If you don't like logging for these cases, just test the "err" return
value from the read() method against the Lua strings "closed" and
"client aborted", as in
if err == "closed" or err == "client aborted" then
-- silently quit
return ngx.exit(444)
end
Because you're already handling cosocket errors yourself in Lua, you
can also disable the automatic error logging in ngx_lua:
lua_socket_log_errors off;
> As there is nothing to write to the disk, we want to safely exit the
> handler. What is the best way to handle this cases?
>
See above.
Best regards,
-agentzh