-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reads of ngx request body socket fails with (17: File exists) randomly on SPDY #252
Comments
Thank you for the report! ngx_lua is known to have various problems with nginx's new SPDY support. I haven't got a chance to really look at it. I'll try to find some time to debug such issues. Or will you have the tuits to trace it down and submit a patch? I'd love to accept patches :) Thanks! |
Tried to look into ngx_lua and spdy source, damn magic. [OT] I left C for garbage-collected languages decade ago. That's why I decided to write upload module in Lua instead of trying to take over existing one ;) [/OT]
I switched to |
Ok more facts. This time I tried other event implementations:
or
Both failing on the first |
FYI this still occurs with nginx 1.5.4 and master. I've spent some time to debug it. Here is some
If file is bigger sometimes several small chunks pass with "read event ready: 1" but once 0 occurs it stops. |
@pgaertig Thank you for the debugging! Could you please enable the nginx debugging logs? That way we can get much more information: http://nginx.org/en/docs/debugging_log.html Thanks for your time! |
Ah, I've enabled debug but forgot that server block overrides it locally, thanks for the link. I've rerun my tests, this time 177 bytes file upload. To minimize any parallel interference I've set SSL SPDY (fails with 500): http://pastebin.com/195sw71Y I also repeated it several times after first failed request or next to successful response to other non-Lua url. Results are the same. Thanks! |
@pgaertig Your detailed logs made me finally sit down and have a close look at the new SPDY implementation in the Nginx core for the problem you're seeing. I'm very disappointed to see that Nginx essentially forks the code base specifically for the SPDY protocol. So if 3rd-party modules want to play with the downstream connections directly, they also have to fork their code base specifically for SPDY. This is very sad. The epoll_ctl error that you're seeing is just Nginx's SPDY's read event handler conflicting with ngx_lua's existing read event handler for non-SPDY requests. They're not compatible at all. To make them work together, ngx_lua needs to fork a code path specifically for SPDY in the same way. So this is no easy task to support SPDY in ngx_lua (or other Nginx modules doing clever things on the downstream connections). Because the Nginx company is also concerned about the SPDY compatibility of ngx_lua, I'll write to them for more suggestions and necessary changes in the Nginx core to make it easier for ngx_lua. I'll keep you updated. Finally, I must thank you again for your continuing efforts on fixing this issue :) |
@agentzh Thanks for the action. I am very happy that my investigation helped. I was surprised that official SPDY module is still a patch file. There was similar problem with SSI module and SPDY and they fixed the problem within SPDY module ( http://trac.nginx.org/nginx/ticket/302 ). I suppose the fork problem could be solved by Lua-nginx deserves any effort on both sides to resolve issue because I think it is the best module which gives nginx users the ability to actually implement any server logic they can imagine. The most important is that the problem cause is known now. If you need more tests from me just write here. |
Hello! On Fri, Sep 13, 2013 at 12:32 AM, P Gaertig notifications@github.com wrote:
The SPDY thing has already been merged into the mainline Nginx since
For the forked implementation of ngx.req.socket that'll be
Thank you very much for your compliments :)
Thank you in advance! I'll try to add support for SPDY to my test Best regards, |
You are right I was using https://launchpad.net/~chris-lea/+archive/nginx-devel 1.5.4 DEB package, which had patches left. They are not used by build anymore. |
SPDY is dead. I'm closing this. |
nginx 1.4.1, lua-module from master, luajit
Below is the snippet (https://github.com/pgaertig/nginx-big-upload/blob/master/file_storage_handler.lua) of code catching the problem:
Shortly, 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:Full log http://pastebin.com/KP1cixpS .
The text was updated successfully, but these errors were encountered: