ledgetech / lua-resty-redis-connector

Connection utilities for lua-resty-redis
234 stars 71 forks source link

Bug when more than two slaves on localhost #12

Closed gregkare closed 7 years ago

gregkare commented 7 years ago

We use a master and two slaves on our staging server (using Redis Sentinel), but I recently added two more slaves to test something. redis-connector (0.03-0) is crashing when there are more than two slaves running on localhost:

2017/07/12 08:07:15 [error] 19066#0: *10806 lua entry thread aborted: runtime error: /usr/share/luajit/share/lua/5.1/resty/redis/connector.lua:169: invalid order function for sorting
stack traceback:
coroutine 0:
        [C]: in function 'tbl_sort'
        /usr/share/luajit/share/lua/5.1/resty/redis/connector.lua:169: in function 'connect'

This shouldn't be a problem in production, since running multiple slaves on the same host doesn't make a lot of sense.

pintsized commented 7 years ago

Thanks for this, should now be fixed in master (release v0.04). It'd be great if you can test on your side?

gregkare commented 7 years ago

Will do, thanks. I'll let you know how it goes