From 527bba822ccb889960971df3fbcddf9f2b86e0fd Mon Sep 17 00:00:00 2001 From: hschowdhury Date: Fri, 25 Nov 2022 01:05:45 +0530 Subject: [PATCH 1/6] Adding Redis 5.0.6 support --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a8fdb07..53610aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,5 @@ env: - REDIS_VERSION=3.0.7 - REDIS_VERSION=3.2.11 - REDIS_VERSION=4.0.6 + - REDIS_VERSION=5.0.6 script: make test From e86e80fb6d29ecfa1132ae3e6dbfa6ce1524756d Mon Sep 17 00:00:00 2001 From: hschowdhury Date: Fri, 25 Nov 2022 02:42:29 +0530 Subject: [PATCH 2/6] Modifying Redis TCPKeepAlive value to 60 sec/upgrading version to 5.0.6 --- provision.sh | 2 +- provision/etc/redis.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/provision.sh b/provision.sh index 7e61ca4..fe75f5a 100755 --- a/provision.sh +++ b/provision.sh @@ -23,7 +23,7 @@ sudo apt-get install -y libhiredis-dev libevent-dev python-pip python-dev # Download and install the thing cd /tmp - export REDIS_VERSION=4.0.6 + export REDIS_VERSION=5.0.6 wget http://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz tar xf redis-$REDIS_VERSION.tar.gz ( diff --git a/provision/etc/redis.conf b/provision/etc/redis.conf index 2d24589..9e02215 100644 --- a/provision/etc/redis.conf +++ b/provision/etc/redis.conf @@ -87,7 +87,7 @@ timeout 0 # On other kernels the period depends on the kernel configuration. # # A reasonable value for this option is 60 seconds. -tcp-keepalive 0 +tcp-keepalive 60 # Specify the server verbosity level. # This can be one of: @@ -550,7 +550,7 @@ appendfsync everysec # If you have latency problems turn this to "yes". Otherwise leave it as # "no" that is the safest pick from the point of view of durability. -no-appendfsync-on-rewrite no +no-appendfsync-on-rewrite no #tcg # Automatic rewrite of the append only file. # Redis is able to automatically rewrite the log file implicitly calling From d2a736ce99692bd7e7fa7db010355e39cf6afd38 Mon Sep 17 00:00:00 2001 From: hschowdhury Date: Mon, 5 Dec 2022 11:44:10 +0530 Subject: [PATCH 3/6] Fixing compatibility issue with Redis 5.0.6 --- base.lua | 4 ++-- queue.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base.lua b/base.lua index 73cc977..f77a13c 100644 --- a/base.lua +++ b/base.lua @@ -31,9 +31,9 @@ QlessRecurringJob.__index = QlessRecurringJob Qless.config = {} -- Extend a table. This comes up quite frequently -function table.extend(self, other) +local function extend_table(target, other) for i, v in ipairs(other) do - table.insert(self, v) + table.insert(target, v) end end diff --git a/queue.lua b/queue.lua index 04e8497..370cdfd 100644 --- a/queue.lua +++ b/queue.lua @@ -247,7 +247,7 @@ function QlessQueue:peek(now, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) return jids end @@ -322,7 +322,7 @@ function QlessQueue:pop(now, worker, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) local state for index, jid in ipairs(jids) do From f59d4976ad2524f932103fb1ad70f508749a3c00 Mon Sep 17 00:00:00 2001 From: hschowdhury Date: Tue, 6 Dec 2022 14:35:10 +0530 Subject: [PATCH 4/6] Removing unnecessary codes --- provision/etc/redis.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/etc/redis.conf b/provision/etc/redis.conf index 9e02215..2d24589 100644 --- a/provision/etc/redis.conf +++ b/provision/etc/redis.conf @@ -87,7 +87,7 @@ timeout 0 # On other kernels the period depends on the kernel configuration. # # A reasonable value for this option is 60 seconds. -tcp-keepalive 60 +tcp-keepalive 0 # Specify the server verbosity level. # This can be one of: @@ -550,7 +550,7 @@ appendfsync everysec # If you have latency problems turn this to "yes". Otherwise leave it as # "no" that is the safest pick from the point of view of durability. -no-appendfsync-on-rewrite no #tcg +no-appendfsync-on-rewrite no # Automatic rewrite of the append only file. # Redis is able to automatically rewrite the log file implicitly calling From 49f707402b7f53006d0696cb49ae5baaa0535b44 Mon Sep 17 00:00:00 2001 From: hschowdhury Date: Wed, 7 Dec 2022 13:05:02 +0530 Subject: [PATCH 5/6] Reverting changes queue.lua and base.lua to fix travis build error in andalusia for Redis 5.0.6 --- base.lua | 4 ++-- queue.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base.lua b/base.lua index f77a13c..73cc977 100644 --- a/base.lua +++ b/base.lua @@ -31,9 +31,9 @@ QlessRecurringJob.__index = QlessRecurringJob Qless.config = {} -- Extend a table. This comes up quite frequently -local function extend_table(target, other) +function table.extend(self, other) for i, v in ipairs(other) do - table.insert(target, v) + table.insert(self, v) end end diff --git a/queue.lua b/queue.lua index 370cdfd..04e8497 100644 --- a/queue.lua +++ b/queue.lua @@ -247,7 +247,7 @@ function QlessQueue:peek(now, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - extend_table(jids, self.work.peek(count - #jids)) + table.extend(jids, self.work.peek(count - #jids)) return jids end @@ -322,7 +322,7 @@ function QlessQueue:pop(now, worker, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - extend_table(jids, self.work.peek(count - #jids)) + table.extend(jids, self.work.peek(count - #jids)) local state for index, jid in ipairs(jids) do From d8c58c272045c49d8604097c31f0b4e1e27df791 Mon Sep 17 00:00:00 2001 From: hschowdhury Date: Fri, 23 Dec 2022 18:11:41 +0530 Subject: [PATCH 6/6] Upgrading redis interface and hiredis in requirements.txt support Redis 5.0.6 --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index dfcad9f..5869d68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -hiredis==0.1.0 -redis==2.7.5 +hiredis==1.1.0 +redis==3.5.3 nose==1.3.7