Skip to content

Commit

Permalink
Fix v2.2.0 regressions (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia authored Apr 15, 2019
1 parent ff360fb commit 74d3caf
Show file tree
Hide file tree
Showing 18 changed files with 470 additions and 434 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
v2.2.1
======

This release fixes two regressions introduced by v2.2.0.

Improvements:

* [New documentation chapter](https://centrifugal.github.io/centrifugo/server/grpc_api/) about GRPC API in Centrifugo.

Fixes:

* Fix client disconnect in channels with enabled history but disabled recovery
* Fix wrong Push type sent in Redis engine: Leave message was used where Join required

v2.2.0
======

Expand Down
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ func main() {
if err != nil {
log.Fatal().Msgf("Error creating Centrifuge Node: %v", err)
}
setLogHandler(node)

engineName := viper.GetString("engine")

Expand Down Expand Up @@ -837,6 +836,13 @@ func nodeConfig() *centrifuge.Config {

cfg.NodeInfoMetricsAggregateInterval = time.Duration(v.GetInt("node_info_metrics_aggregate_interval")) * time.Second

level, ok := centrifuge.LogStringToLevel[strings.ToLower(v.GetString("log_level"))]
if !ok {
level = centrifuge.LogLevelInfo
}
cfg.LogLevel = level
cfg.LogHandler = newLogHandler().handle

return cfg
}

Expand Down Expand Up @@ -1105,19 +1111,8 @@ func redisEngineConfig() (*centrifuge.RedisEngineConfig, error) {
}, nil
}

func setLogHandler(n *centrifuge.Node) {
v := viper.GetViper()
level, ok := centrifuge.LogStringToLevel[strings.ToLower(v.GetString("log_level"))]
if !ok {
level = centrifuge.LogLevelInfo
}
handler := newLogHandler()
n.SetLogHandler(level, handler.handle)
}

type logHandler struct {
entries chan centrifuge.LogEntry
handler func(entry centrifuge.LogEntry)
}

func newLogHandler() *logHandler {
Expand Down
14 changes: 5 additions & 9 deletions misc/release/notes.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
This release is based on latest refactoring of Centrifuge library. The refactoring opens a road for possible interesting improvements in Centrifugo – such as possibility to use any PUB/SUB broker instead of Redis (here is an [example of possible integration](https://github.com/centrifugal/centrifugo/pull/273) with Nats server), or even combine another broker with existing Redis engine features to still have recovery and presence features. Though these ideas are not implemented in Centrifugo yet. Performance of broadcast operations can be slightly decreased due to some internal changes in Centrifuge library. Also take a close look at backwards incompatible changes section below for one breaking change.
This release fixes two regressions introduced by v2.2.0.

Improvements:

* Track client position in channels with `history_recover` option enabled and disconnect in case of insufficient state. This resolves an edge case when messages could be lost in channels with `history_recover` option enabled after node reconnect to Redis (imagine situation when Redis was unavailable for some time but before Centrifugo node reconnects publisher was able to successfully send a message to channel on another node which reconnected to Redis faster). With new mechanism client won't miss messages though can receive them with some delay. As such situations should be pretty rare on practice it should be a reasonable compromise for applications. New mechanism adds more load on Redis as Centrifugo node periodically polls channel history state. The load is linearly proportional to amount of active channels with `history_recover` option on. By default Centrifugo will check client position in channel stream not often than once in 40 seconds so an additional load on Redis should not be too high
* New options for more flexible conrol over exposed endpoint interfaces and ports: `internal_address`, `tls_external`, `admin_external`. See description calling `centrifugo -h`. [#262](https://github.com/centrifugal/centrifugo/pull/262), [#264](https://github.com/centrifugal/centrifugo/pull/264)
* Small optimizations in Websocket and SockjS transports writes
* Server initiated disconnect number metrics labeled with disconnect code
* [New documentation chapter](https://centrifugal.github.io/centrifugo/server/grpc_api/) about GRPC API in Centrifugo.

Backwards incompatible changes:
Fixes:

* This release removes a possibility to set `uid` to Publication over API. This feature was not documented in [API reference](https://centrifugal.github.io/centrifugo/server/api/) and `uid` field does not make sense to be kept on client protocol top level as in Centrifugo v2 it does not serve any internal protocol purpose. This is just an application specific information that can be put into `data` payload

Release is based on Go 1.12.x
* Fix client disconnect in channels with enabled history but disabled recovery
* Fix wrong Push type sent in Redis engine: Leave message was used where Join required
47 changes: 21 additions & 26 deletions vendor/github.com/centrifugal/centrifuge/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74d3caf

Please sign in to comment.