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

closed socket when I enable set_keepalive #31

Open
ghost opened this issue Jul 20, 2019 · 1 comment
Open

closed socket when I enable set_keepalive #31

ghost opened this issue Jul 20, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 20, 2019

This is my config:

local rc = require("resty.redis.connector").new({
                connect_timeout = 50,
                read_timeout = 5000,
                keepalive_timeout = 30000
            })

            local redis, err1 = rc:connect({
                url = "redis://127.0.0.1:6379",
            })

            if not redis then
                ngx.say( err1)    
            else
                ngx.say('connection fine')    
            end

            local ok, err = rc:set_keepalive(redis)  

I'm getting this error:
[error] 4044#0: *1068056 attempt to send data on a closed socket: u:00007F2BABA05D48, c:0000000000000000, ft:0 eof:0, client: MY IP, server: , request: "GET /foo HTTP/1.1", host: "SERVER IP"

When I disable keepalive setting, get this error:
[error] 4147#0: *1089971 lua tcp socket connect timed out, when connecting to 127.0.0.1:6379,

When I comment out the line related to rc:set_keepalive it works on single requests and crashes on 100 requests.

@vento-vt
Copy link

Try to check redis.conf
Use the solution that was suggested here:
openresty/lua-resty-redis#140

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