From 585b7883215ca553b5235d8d3e06a6504c96f052 Mon Sep 17 00:00:00 2001 From: Ian Yap Date: Thu, 21 Dec 2023 23:40:53 -0800 Subject: [PATCH 1/5] Fixing the upstream config host --- proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index 706273a..acdf4aa 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -389,7 +389,7 @@ func (p *Proxy) healthCheckSingleConnection(key string, wg *sync.WaitGroup) { if !healthy { p.log.Warn("Server failed to respond; Deleting the listener", zap.String("server", key)) p.removeListener(key) - if key == p.localConfigHost { + if key == p.upstreamConfigHost { // add the upstream config host back; we always need to have that minimally // but hopefully this time, the connection is re-established to the right IP p.ensureListenerForUpstream(key, "") From c991acda424ef143f36a5861d3d6131c9f4aeb5a Mon Sep 17 00:00:00 2001 From: Ian Yap Date: Fri, 22 Dec 2023 18:12:08 -0800 Subject: [PATCH 2/5] testing changes --- README.md | 2 +- go.mod | 2 +- handlers/blocker.go | 4 ++-- handlers/blocker_internal_test.go | 2 +- handlers/blocker_test.go | 2 +- handlers/command.go | 4 ++-- handlers/command_test.go | 2 +- handlers/mocks.go | 2 +- handlers/reservation.go | 2 +- handlers/subscription.go | 4 ++-- handlers/subscription_internal_test.go | 2 +- handlers/subscription_test.go | 2 +- messenger/messenger.go | 2 +- messenger/messenger_test.go | 2 +- proxy/proxy.go | 6 +++--- proxy/proxy_test.go | 2 +- proxy/test_helpers.go | 2 +- redisbetween.go | 4 ++-- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 332127a..954fae1 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ res := client.Do(context.Background(), "ping") ### Installation ``` -go install github.com/coinbase/redisbetween +go install github.com/d2army/redisbetween ``` ### Usage diff --git a/go.mod b/go.mod index fdad20a..2617dd8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/coinbase/redisbetween +module github.com/d2army/redisbetween go 1.13 diff --git a/handlers/blocker.go b/handlers/blocker.go index ed6ad7f..a7d60f5 100644 --- a/handlers/blocker.go +++ b/handlers/blocker.go @@ -10,8 +10,8 @@ import ( "time" "github.com/coinbase/memcachedbetween/pool" - "github.com/coinbase/redisbetween/messenger" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/messenger" + "github.com/d2army/redisbetween/redis" "go.uber.org/zap" ) diff --git a/handlers/blocker_internal_test.go b/handlers/blocker_internal_test.go index a34d0e2..1cf0760 100644 --- a/handlers/blocker_internal_test.go +++ b/handlers/blocker_internal_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" "github.com/stretchr/testify/assert" "go.uber.org/zap" "go.uber.org/zap/zaptest/observer" diff --git a/handlers/blocker_test.go b/handlers/blocker_test.go index 4d4a0ec..1d42089 100644 --- a/handlers/blocker_test.go +++ b/handlers/blocker_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/coinbase/redisbetween/proxy" + "github.com/d2army/redisbetween/proxy" "github.com/go-redis/redis/v8" "github.com/stretchr/testify/assert" ) diff --git a/handlers/command.go b/handlers/command.go index 361e9a9..90978a8 100644 --- a/handlers/command.go +++ b/handlers/command.go @@ -11,8 +11,8 @@ import ( "time" "github.com/coinbase/memcachedbetween/pool" - "github.com/coinbase/redisbetween/messenger" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/messenger" + "github.com/d2army/redisbetween/redis" "github.com/DataDog/datadog-go/statsd" "go.uber.org/zap" diff --git a/handlers/command_test.go b/handlers/command_test.go index 7d041c7..d8fc41b 100644 --- a/handlers/command_test.go +++ b/handlers/command_test.go @@ -3,7 +3,7 @@ package handlers import ( "testing" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" "github.com/stretchr/testify/assert" ) diff --git a/handlers/mocks.go b/handlers/mocks.go index 6b637b8..928af64 100644 --- a/handlers/mocks.go +++ b/handlers/mocks.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-go/statsd" "github.com/coinbase/memcachedbetween/pool" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" "github.com/stretchr/testify/assert" "go.uber.org/zap" "go.uber.org/zap/zaptest/observer" diff --git a/handlers/reservation.go b/handlers/reservation.go index 26c61a3..a5a7b94 100644 --- a/handlers/reservation.go +++ b/handlers/reservation.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-go/statsd" "github.com/coinbase/mongobetween/util" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" ) type reservation interface { diff --git a/handlers/subscription.go b/handlers/subscription.go index 4d119a7..6c93cc2 100644 --- a/handlers/subscription.go +++ b/handlers/subscription.go @@ -9,8 +9,8 @@ import ( "time" "github.com/coinbase/memcachedbetween/pool" - "github.com/coinbase/redisbetween/messenger" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/messenger" + "github.com/d2army/redisbetween/redis" "go.uber.org/zap" ) diff --git a/handlers/subscription_internal_test.go b/handlers/subscription_internal_test.go index 1f205d5..644821f 100644 --- a/handlers/subscription_internal_test.go +++ b/handlers/subscription_internal_test.go @@ -3,7 +3,7 @@ package handlers import ( "testing" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" "github.com/stretchr/testify/assert" ) diff --git a/handlers/subscription_test.go b/handlers/subscription_test.go index edc64a7..2eb6aa2 100644 --- a/handlers/subscription_test.go +++ b/handlers/subscription_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/coinbase/redisbetween/proxy" + "github.com/d2army/redisbetween/proxy" "github.com/go-redis/redis/v8" "github.com/stretchr/testify/assert" ) diff --git a/messenger/messenger.go b/messenger/messenger.go index 81a2c75..66aa11e 100644 --- a/messenger/messenger.go +++ b/messenger/messenger.go @@ -7,7 +7,7 @@ import ( "time" "github.com/coinbase/memcachedbetween/pool" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" "go.uber.org/zap" ) diff --git a/messenger/messenger_test.go b/messenger/messenger_test.go index efc4582..31f21f1 100644 --- a/messenger/messenger_test.go +++ b/messenger/messenger_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/redis" "github.com/stretchr/testify/assert" "go.uber.org/zap/zaptest" ) diff --git a/proxy/proxy.go b/proxy/proxy.go index acdf4aa..0814d45 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -19,9 +19,9 @@ import ( "github.com/coinbase/mongobetween/util" "github.com/mediocregopher/radix/v3" - "github.com/coinbase/redisbetween/config" - "github.com/coinbase/redisbetween/handlers" - "github.com/coinbase/redisbetween/redis" + "github.com/d2army/redisbetween/config" + "github.com/d2army/redisbetween/handlers" + "github.com/d2army/redisbetween/redis" "github.com/DataDog/datadog-go/statsd" "go.uber.org/zap" diff --git a/proxy/proxy_test.go b/proxy/proxy_test.go index ab38369..d41e6e6 100644 --- a/proxy/proxy_test.go +++ b/proxy/proxy_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/coinbase/redisbetween/messenger" + "github.com/d2army/redisbetween/messenger" "github.com/go-redis/redis/v8" "github.com/stretchr/testify/assert" ) diff --git a/proxy/test_helpers.go b/proxy/test_helpers.go index ccf6088..d659059 100644 --- a/proxy/test_helpers.go +++ b/proxy/test_helpers.go @@ -10,7 +10,7 @@ import ( "time" "github.com/DataDog/datadog-go/statsd" - "github.com/coinbase/redisbetween/config" + "github.com/d2army/redisbetween/config" "github.com/go-redis/redis/v8" "github.com/stretchr/testify/assert" "go.uber.org/zap" diff --git a/redisbetween.go b/redisbetween.go index f5b39ac..bb454ee 100644 --- a/redisbetween.go +++ b/redisbetween.go @@ -12,8 +12,8 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" - "github.com/coinbase/redisbetween/config" - "github.com/coinbase/redisbetween/proxy" + "github.com/d2army/redisbetween/config" + "github.com/d2army/redisbetween/proxy" ) func main() { From a99d891317f36a46f32fe0b6c27e97c4c2815436 Mon Sep 17 00:00:00 2001 From: Ian Yap Date: Mon, 25 Dec 2023 18:43:56 -0800 Subject: [PATCH 3/5] testing again --- proxy/proxy.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index 0814d45..c35ad90 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -389,11 +389,11 @@ func (p *Proxy) healthCheckSingleConnection(key string, wg *sync.WaitGroup) { if !healthy { p.log.Warn("Server failed to respond; Deleting the listener", zap.String("server", key)) p.removeListener(key) - if key == p.upstreamConfigHost { - // add the upstream config host back; we always need to have that minimally - // but hopefully this time, the connection is re-established to the right IP - p.ensureListenerForUpstream(key, "") - } + //if key == p.upstreamConfigHost { + // add the upstream config host back; we always need to have that minimally + // but hopefully this time, the connection is re-established to the right IP + p.ensureListenerForUpstream(key, "") + //} } } From 170bc08e723441ba0f613a2a396b35b1b86f0951 Mon Sep 17 00:00:00 2001 From: Ian Yap Date: Tue, 26 Dec 2023 10:36:29 -0800 Subject: [PATCH 4/5] removing --- proxy/proxy.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index c35ad90..0814d45 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -389,11 +389,11 @@ func (p *Proxy) healthCheckSingleConnection(key string, wg *sync.WaitGroup) { if !healthy { p.log.Warn("Server failed to respond; Deleting the listener", zap.String("server", key)) p.removeListener(key) - //if key == p.upstreamConfigHost { - // add the upstream config host back; we always need to have that minimally - // but hopefully this time, the connection is re-established to the right IP - p.ensureListenerForUpstream(key, "") - //} + if key == p.upstreamConfigHost { + // add the upstream config host back; we always need to have that minimally + // but hopefully this time, the connection is re-established to the right IP + p.ensureListenerForUpstream(key, "") + } } } From 28241eb02f01fe4570a591f5b24a5bdb793629fe Mon Sep 17 00:00:00 2001 From: Ian Yap Date: Thu, 25 Jan 2024 13:24:15 -0800 Subject: [PATCH 5/5] Logging --- proxy/proxy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy/proxy.go b/proxy/proxy.go index 0814d45..3e88786 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -244,6 +244,7 @@ func (p *Proxy) ensureNewListenersRemoveOld(newNodes []string) { if node == p.upstreamConfigHost { continue } + p.log.Warn("ensureNewListenersRemoveOld: Removing listener for", zap.String("node", node)) p.removeListener(node) }