openresty / openresty/lua-resty-upload
Got "closed" error after call read method of resty.upload
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 414
- Forks
- 110
- Avg merge
- 2h 43m
- Merged PRs (30d)
- 1
Description
Hi, I encountered an occasional problem in a http request, the following is the sample code
local upload = require "resty.upload"
local form, err = upload.new(4 * 1024)
****
form:set_timeout(5000)
local typ, res, err = form:read()
The value of err is "closed", then server return a message(by using ngx.print and ngx.exit(ngx.HTTP_OK)) and client can receive it. It seems that the socket was closed but client can still get the return of server
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the resty.upload sample in the issue, especially form:read() after set_timeout(5000), and trace how the "closed" error is produced. Reproduce the occasional response and compare the read error with the server's ngx.print and ngx.exit behavior; done means the behavior is explained and the issue has a verified fix or documented expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100