You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error occurs very often:
close() failed (9: Bad file descriptor)
This is produced at the end of the complex PUT workflow (described below) after main data already written and re-sended and a small piece of data should be placed in a separate file (it is point 5 of the PUT workflow). The exact code:
The last file:close is the problem that returns the error "close() failed (9: Bad file descriptor)" .
Requesting model is the following. There are many PUT/HEAD/GET/DELETE requests at 1Gbps speed. Most PUT requests write file data locally and send it to other service using this library: https://github.com/ledgetech/lua-resty-http
so chunks are read, written to local file and forwarded to other service.
GET requests read file and "print" data to output.
Chunk size is 65536 bytes.
PUT is most interested since http request to forward data is sent to local "proxy_pass" location that passes query to an external service.
So PUT sequence is:
Get PUT request
Open local file to write
Connect to local (127.0.0.1:80/local_proxy_pass) location with proxy_pass using resty.http library
3.1. for body reader an iterator function is passed where
3.1.1. receive a chunk data with socket:receive(current_chunk_size)
3.1.2. write data to local file
3.1.3. return data
When all data is read - close the file
At very end of the request create and write a small file.
Input and external requests are secured with https.
The text was updated successfully, but these errors were encountered:
Hi!
The following error occurs very often:
close() failed (9: Bad file descriptor)
This is produced at the end of the complex PUT workflow (described below) after main data already written and re-sended and a small piece of data should be placed in a separate file (it is point 5 of the PUT workflow). The exact code:
The last file:close is the problem that returns the error "close() failed (9: Bad file descriptor)" .
Requesting model is the following. There are many PUT/HEAD/GET/DELETE requests at 1Gbps speed. Most PUT requests write file data locally and send it to other service using this library:
https://github.com/ledgetech/lua-resty-http
so chunks are read, written to local file and forwarded to other service.
GET requests read file and "print" data to output.
Chunk size is 65536 bytes.
PUT is most interested since http request to forward data is sent to local "proxy_pass" location that passes query to an external service.
So PUT sequence is:
3.1. for body reader an iterator function is passed where
3.1.1. receive a chunk data with socket:receive(current_chunk_size)
3.1.2. write data to local file
3.1.3. return data
Input and external requests are secured with https.
The text was updated successfully, but these errors were encountered: