Skip to content
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

request to aws kinesis getRecords endpoint aborted by error 'closed' #57

Open
umegaya opened this issue Jul 17, 2020 · 0 comments
Open

Comments

@umegaya
Copy link

umegaya commented Jul 17, 2020

hi, I'm author of lua-aws, lua implementation of aws API which supports openresty. thank you for creating resty-cli, it helps to check lua-aws' behavior in openresty!

this issue may relate with both resty-cli and lua-nginx-module or nginx itself. if here is not proper place to report the issue, please kindly show me pointer.

problem description

I tried to send request to AWS kinesis getRecord endpoint(https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html) with using lua-resty-http(https://github.com/ledgetech/lua-resty-http) like https://github.com/umegaya/lua-aws/blob/master/lua-aws/engines/http/lua-resty-http.lua, which I think no special usage there.

then lua-aws got following error.

kinesis:v[2013-12-02]:GetRecords:error:./lua-aws/engines/http/lua-resty-http.lua:27: closed

with further investigation, it seems to caused by failure of ngx.socket.tcp.receive(https://github.com/ledgetech/lua-resty-http/blob/master/lib/resty/http.lua#L354), likely comes from lua-nginx-module(https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_socket_tcp.c#L2156)

some insight

I don't think it is a problem of our usage of lua-resty-http and lua-nginx-module because other kinesis endpoint like putRecords(https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html) works perfectly.

also, this does not seems to be kinesis' getRecords problem, because if we use luasocket to communicate with kinesis getRecords endpoint, it works as expected.

I guess nginx or lua-nginx-module detect connection close a bit earlier (maybe because of getRecords endpoint behavior which does not affect luasocket implementation), than getRecords API expected for some reason.

any idea why this problem happens/workaround for the issue?

regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant