-
Notifications
You must be signed in to change notification settings - Fork 113
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
lua tcp socket read timed out #35
Comments
@bryant24 You'll have to prepare a minimal and standalone example that can easily reproduce the issue on our side. Otherwise we cannot really help you since there are too many things that can go wrong on your side. |
I wrote some script to merge the file chunks that have uploaded ,then I found the final merged file can not be unzipped (user upload one zip file), maybe upload chunk failed because the user's network status is too weak,the last upload chunk is not the last chunk,the upload progress failed! |
Hi, Have you solved the timeout issue? I got the same issue over and over again. My code is nearly the same
The timeout occurs randomly (1 out of 10 uploads) even the image that is uploaded is rather small, just few hundred of kb. @agentzh I wonder what causes form:read() timeout and how to know/debug exactly what happens under the hood |
@pcdinh are you on Linux, or on Windows? Can you provide most simple config and simple (eg. Python) script uploading file that together lead to this timeout in short time? |
@pcdinh The easiest way to debug this is to provide a minimal and self-contained example that we can reproduce it on our side. Failing that, you can temporarily enable the nginx debug logs (error logs at |
Here is the lua script that I used to debug my timeout issue:
I used a ResumableJS script http://www.resumablejs.com/ to upload a file to OpenResty server and found the following log:
Here is what I found: My lua script is very fast at reading header. Everything can be read and parse at the same second: 2019/03/01 11:06:47. However it is extremely slow when reading body part: 8 seconds (second 47th to 55th)
I think that it is the reason why timeout occurs. However I don't understand what is the root cause |
My environment: Ubuntu 18.01
lua-resty-upload 0.10 (unmodified) |
@pcdinh what is file size you are uploading? |
@pcdinh it doesn't take so much time. Put I couldn't get timeout, I tested 1G file on localhost, and it's being parsed quick and upload finishes without any problems. Your logs are fine, you get all that's needed - reading body and eof at the end of upload. Maybe there's too low timeout on your client side? |
hi,I use lua-resty-upload to handle big file upload, I use an extension of this version which have the part-split upload function, repos link, when the last part upload complete, the nginx error log sometimes show this error:
lua tcp socket read timed out
and did not merge all the part to one file,please give me a help!thx!
this is upload.lua script below:
The text was updated successfully, but these errors were encountered: