{"action":"created","issue":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/252","repository_url":"https://api.github.com/repos/openresty/lua-nginx-module","labels_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/252/comments","events_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/252/events","html_url":"https://github.com/openresty/lua-nginx-module/issues/252","id":16104936,"number":252,"title":"Reads of ngx request body socket fails with (17: File exists) randomly on SPDY","user":{"login":"pgaertig","id":541930,"avatar_url":"https://avatars.githubusercontent.com/u/541930?v=3","gravatar_id":"","url":"https://api.github.com/users/pgaertig","html_url":"https://github.com/pgaertig","followers_url":"https://api.github.com/users/pgaertig/followers","following_url":"https://api.github.com/users/pgaertig/following{/other_user}","gists_url":"https://api.github.com/users/pgaertig/gists{/gist_id}","starred_url":"https://api.github.com/users/pgaertig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgaertig/subscriptions","organizations_url":"https://api.github.com/users/pgaertig/orgs","repos_url":"https://api.github.com/users/pgaertig/repos","events_url":"https://api.github.com/users/pgaertig/events{/privacy}","received_events_url":"https://api.github.com/users/pgaertig/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2013-06-27T17:54:30Z","updated_at":"2016-02-16T17:43:07Z","closed_at":"2016-02-16T17:43:07Z","body":"nginx 1.4.1, lua-module from master, luajit\r\n\r\nBelow is the snippet (https://github.com/pgaertig/nginx-big-upload/blob/master/file_storage_handler.lua) of code catching the problem:\r\n\r\n    ngx.log(ngx.ERR, self.left)\r\n    ngx.log(ngx.ERR, current_chunk_size) -- 4096\r\n\r\n    ngx.log(ngx.ERR, 'raw0')\r\n    local chunk, err =  self.socket:receive(current_chunk_size)\r\n    ngx.log(ngx.ERR, 'raw1')\r\n    if err then\r\n        return nil, \"socket:receive :\"..err\r\n    end\r\n\r\nShortly, gigabytes of data is read with plain HTTP-SSL, but when SPDY is enabled usually the first or second socket read fails with `epoll_ctl(1, 21) failed (17: File exists)`. Excerpt of log:\r\n\r\n    2013/06/27 18:48:38 [error] 10188#0: *1 [lua] request_processor.lua:35: raw_body_by_chunk(): left 28672, client: 127.0.0.1, server: foo.com, request: \"POST /upload HTTP/1.1\", host: \"foo.com\", referrer: \"https://foo.com/\"\r\n    2013/06/27 18:48:38 [error] 10188#0: *1 [lua] request_processor.lua:36: raw_body_by_chunk(): read size 4096, client: 127.0.0.1, server: foo.com, request: \"POST /upload HTTP/1.1\", host: \"foo.com\", referrer: \"https://foo.com/\"\r\n    2013/06/27 18:48:38 [error] 10188#0: *1 [lua] request_processor.lua:38: raw_body_by_chunk(): raw0, client: 127.0.0.1, server: foo.com, request: \"POST /upload HTTP/1.1\", host: \"foo.com\", referrer: \"https://foo.com/\"\r\n    2013/06/27 18:48:38 [alert] 10188#0: *1 epoll_ctl(1, 21) failed (17: File exists), client: 127.0.0.1, server: foo.com, request: \"POST /upload HTTP/1.1\", host: \"foo.com\", referrer: \"https://foo.com/\"\r\n    2013/06/27 18:48:38 [error] 10188#0: *1 [lua] request_processor.lua:40: raw_body_by_chunk(): raw1, client: 127.0.0.1, server: foo.com, request: \"POST /upload HTTP/1.1\", host: \"foo.com\", referrer: \"https://foo.com/\"\r\n    2013/06/27 18:48:38 [error] 10188#0: *1 [lua] big-upload.lua:41: socket:receive :error, client: 127.0.0.1, server: foo.com, request: \"POST /upload HTTP/1.1\", host: \"foo.com\", referrer: \"https://foo.com/\"\r\n\r\n\r\n\r\nFull log http://pastebin.com/KP1cixpS .\r\n"},"comment":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/comments/184794094","html_url":"https://github.com/openresty/lua-nginx-module/issues/252#issuecomment-184794094","issue_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/252","id":184794094,"user":{"login":"agentzh","id":56241,"avatar_url":"https://avatars.githubusercontent.com/u/56241?v=3","gravatar_id":"","url":"https://api.github.com/users/agentzh","html_url":"https://github.com/agentzh","followers_url":"https://api.github.com/users/agentzh/followers","following_url":"https://api.github.com/users/agentzh/following{/other_user}","gists_url":"https://api.github.com/users/agentzh/gists{/gist_id}","starred_url":"https://api.github.com/users/agentzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentzh/subscriptions","organizations_url":"https://api.github.com/users/agentzh/orgs","repos_url":"https://api.github.com/users/agentzh/repos","events_url":"https://api.github.com/users/agentzh/events{/privacy}","received_events_url":"https://api.github.com/users/agentzh/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T17:43:07Z","updated_at":"2016-02-16T17:43:07Z","body":"SPDY is dead. I'm closing this."}}