Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Resolv hostname problem #59
When set the ip to create a connect with my redis server, it work right. But if i set the hostname of my redis server, i get follow message:
2015/05/18 19:33:13 [error] 12297#0: *2592 attempt to send data on a closed socket: u:000000000243ABA8, c:0000000000000000, ft:8 eof:0, client: 220.127.116.11, server
The code that work right:
The code that break down:
@ismaelvacco This error happens when your previous redis operation failed with a fatal error (in that case, the underlying cosocket is automatically closed). The fix is simple: just always properly handle the errors of every redis opreations that could possibly fail in your own Lua code.
I too have encountered this issue.
The issue seems to be completely related to the hostname not resolving, as interchanging the ip address of the hostname will also resolve the problem.
However in the case of aws - hostnames are preferable because we are using cname records that point to amazon's elasticache instances, which the underlying ip address is not guaranteed to be fixed.
@ismaelvacco I have a fix for this, and its very clean. My best guess is that Lua does not know how to resolve the hostname.
We are inside a VPC, we have set our vpc to use the 10.8.0.0/16 address range. In my /etc/nginx/nginx.conf, i added the following line in the nginx conf file:
The basis for that line comes from the following url: