From 741f27d41b9a9e94af2779a835f871971e2418d1 Mon Sep 17 00:00:00 2001 From: Alexander Emelin Date: Thu, 24 Sep 2020 11:29:14 +0300 Subject: [PATCH] update centrifuge, prepare v2.7.1 --- CHANGELOG.md | 9 ++++++++ go.mod | 2 +- go.sum | 4 ++-- misc/release/notes.md | 16 ++------------ .../centrifugal/centrifuge/changelog.md | 22 +++++++++++++++++++ .../centrifugal/centrifuge/client.go | 12 +++++----- vendor/modules.txt | 2 +- 7 files changed, 43 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8863427f80..4341dbf001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +v2.7.1 +====== + +No backwards incompatible changes here. + +Fixes: + +* Fix non-working websocket close with custom disconnect code: this is a regression introduced by v2.6.2 + v2.7.0 ====== diff --git a/go.mod b/go.mod index 0750267fe7..1ad361a597 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/FZambia/statik v0.1.2-0.20180217151304-b9f012bb2a1b github.com/FZambia/viper-lite v0.0.0-20171108064948-d5a31e6aa18b github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af - github.com/centrifugal/centrifuge v0.11.1-0.20200914173515-3f1869a4321d + github.com/centrifugal/centrifuge v0.11.2 github.com/centrifugal/protocol v0.3.4 github.com/cristalhq/jwt/v3 v3.0.0 github.com/gogo/protobuf v1.3.1 diff --git a/go.sum b/go.sum index db192a1ed7..7913a468e4 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/centrifugal/centrifuge v0.11.1-0.20200914173515-3f1869a4321d h1:6x7bJBTft3wI0aLtUNzMtm5K3ULsLWh+MkUAh2YHQgo= -github.com/centrifugal/centrifuge v0.11.1-0.20200914173515-3f1869a4321d/go.mod h1:jdFw/2dBFpME3OTisc5FVAC1ilqodnyMnQFjem0k0yg= +github.com/centrifugal/centrifuge v0.11.2 h1:6M4R2cKBs6DKNZ3XX1Kn1uGOQRpzFF+iMUb6FIK1Ww4= +github.com/centrifugal/centrifuge v0.11.2/go.mod h1:jdFw/2dBFpME3OTisc5FVAC1ilqodnyMnQFjem0k0yg= github.com/centrifugal/protocol v0.3.4 h1:9q22iSp4CQOdQahfopvfmWWxDbj1Lo7ERG2j56mAxkE= github.com/centrifugal/protocol v0.3.4/go.mod h1:2YbBCaDwQHl37ErRdMrKSj18X2yVvpkQYtSX6aVbe5A= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= diff --git a/misc/release/notes.md b/misc/release/notes.md index bab56bc36f..9eca057f6a 100644 --- a/misc/release/notes.md +++ b/misc/release/notes.md @@ -1,17 +1,5 @@ -This release has minor backwards incompatible changes in some Prometheus/Graphite metric names. This means that you may need to adapt your monitoring dashboards a bit. See details below. - -Improvements: - -* Previously metrics exposed by Centrifuge library (which Centrifugo is built on top of) belonged to `centrifuge` Prometheus namespace. This lead to a situation where part of Centrifugo metrics belonged to `centrifugo` and part to `centrifuge` Prometheus namespaces. Starting from v2.7.0 Centrifuge library specific metrics also belong to `centrifugo` namespace. So the rule to migrate is simple: if see `centrifuge` word in a metric name – change it to `centrifugo`. -* Refreshed login screen of admin web interface with moving Centrifugo logo on canvas – just check it out! -* New gauge that shows amount of running Centrifugo nodes -* Centrifugal organization just got [the first baker on Opencollective](https://opencollective.com/centrifugal) ❤️. This is a nice first step in making Centrifugo development sustainable. +No backwards incompatible changes here. Fixes: -* Fix `messages_sent_count` counter which did not show control, join and leave messages - -**Coming soon 🔥:** - -* Official Grafana Dashboard for Prometheus storage is on its way to Centrifugo users. [Track this issue](https://github.com/centrifugal/centrifugo/issues/383) for a status, the work almost finished. -* Official Centrifugo Helm Chart for Kubernetes. [Track this issue](https://github.com/centrifugal/centrifugo/issues/385) for a status, the work almost finished. +* Fix non-working websocket close with custom disconnect code: this is a regression introduced by v2.6.2 diff --git a/vendor/github.com/centrifugal/centrifuge/changelog.md b/vendor/github.com/centrifugal/centrifuge/changelog.md index fe956bfda3..65e57be81f 100644 --- a/vendor/github.com/centrifugal/centrifuge/changelog.md +++ b/vendor/github.com/centrifugal/centrifuge/changelog.md @@ -1,3 +1,25 @@ +v0.11.2 +======= + +* Fix non-working websocket close with custom disconnect code: this is a regression introduced by v0.11.0. + +v0.11.1 +======= + +* Added `MetricsNamespace` field of `Config` to configure Prometheus metrics namespace used by Centrifuge library internal metrics +* Fix `messages_sent_counter` – it now correctly counts Control, Join and Leave messages +* Redis cluster integration now tested in CI + +``` +$ gorelease -base v0.11.0 -version v0.11.1 +github.com/centrifugal/centrifuge +--------------------------------- +Compatible changes: +- Config.MetricsNamespace: added + +v0.11.1 is a valid semantic version for this release. +``` + v0.11.0 ======= diff --git a/vendor/github.com/centrifugal/centrifuge/client.go b/vendor/github.com/centrifugal/centrifuge/client.go index 03b8f1777d..ba28a52bd8 100644 --- a/vendor/github.com/centrifugal/centrifuge/client.go +++ b/vendor/github.com/centrifugal/centrifuge/client.go @@ -601,7 +601,7 @@ func (c *Client) Handle(data []byte) bool { if len(data) == 0 { c.node.logger.log(newLogEntry(LogLevelError, "empty client request received", map[string]interface{}{"client": c.ID(), "user": c.UserID()})) - _ = c.close(DisconnectBadRequest) + go func() { _ = c.close(DisconnectBadRequest) }() return false } @@ -617,7 +617,7 @@ func (c *Client) Handle(data []byte) bool { break } c.node.logger.log(newLogEntry(LogLevelInfo, "error decoding command", map[string]interface{}{"data": string(data), "client": c.ID(), "user": c.UserID(), "error": err.Error()})) - _ = c.close(DisconnectBadRequest) + go func() { _ = c.close(DisconnectBadRequest) }() protocol.PutCommandDecoder(protoType, decoder) protocol.PutReplyEncoder(protoType, encoder) return false @@ -640,7 +640,7 @@ func (c *Client) Handle(data []byte) bool { } protocol.PutCommandDecoder(protoType, decoder) protocol.PutReplyEncoder(protoType, encoder) - _ = c.close(disconnect) + go func() { _ = c.close(disconnect) }() return fmt.Errorf("flush error") } } @@ -661,7 +661,7 @@ func (c *Client) Handle(data []byte) bool { if disconnect != DisconnectNormal { c.node.logger.log(newLogEntry(LogLevelInfo, "disconnect after handling command", map[string]interface{}{"command": fmt.Sprintf("%v", cmd), "client": c.ID(), "user": c.UserID(), "reason": disconnect.Reason})) } - _ = c.close(disconnect) + go func() { _ = c.close(disconnect) }() if encodeErr == nil { protocol.PutCommandDecoder(protoType, decoder) protocol.PutReplyEncoder(protoType, encoder) @@ -669,7 +669,7 @@ func (c *Client) Handle(data []byte) bool { return false } if encodeErr != nil { - _ = c.close(DisconnectServerError) + go func() { _ = c.close(DisconnectServerError) }() return false } } @@ -681,7 +681,7 @@ func (c *Client) Handle(data []byte) bool { if c.node.logger.enabled(LogLevelDebug) { c.node.logger.log(newLogEntry(LogLevelDebug, "disconnect after sending reply", map[string]interface{}{"client": c.ID(), "user": c.UserID(), "reason": disconnect.Reason})) } - _ = c.close(disconnect) + go func() { _ = c.close(disconnect) }() protocol.PutCommandDecoder(protoType, decoder) protocol.PutReplyEncoder(protoType, encoder) return false diff --git a/vendor/modules.txt b/vendor/modules.txt index d430e3269d..1a313a189c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -10,7 +10,7 @@ github.com/FZambia/viper-lite github.com/ajstarks/svgo # github.com/beorn7/perks v1.0.1 github.com/beorn7/perks/quantile -# github.com/centrifugal/centrifuge v0.11.1-0.20200914173515-3f1869a4321d +# github.com/centrifugal/centrifuge v0.11.2 github.com/centrifugal/centrifuge github.com/centrifugal/centrifuge/internal/bufpool github.com/centrifugal/centrifuge/internal/cancelctx