mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 10:10:42 -07:00
Remove update of start in readLoop
That broke sending async INFO in case where there was an update between accepting the tcp connection and receiving the CONNECT that indicates that client can receive async INFO. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
committed by
Derek Collison
parent
a693b677c6
commit
f76f0df5ce
@@ -894,10 +894,7 @@ func (c *client) readLoop() {
|
||||
// Check the per-account-cache for closed subscriptions
|
||||
cpacc := c.kind == ROUTER || c.kind == GATEWAY
|
||||
// Last per-account-cache check for closed subscriptions
|
||||
now := time.Now()
|
||||
lpacc := now
|
||||
// Update our notion of when we started. Useful for better initial RTT estimation.
|
||||
c.start = now
|
||||
lpacc := time.Now()
|
||||
c.mu.Unlock()
|
||||
|
||||
defer func() {
|
||||
|
||||
@@ -753,6 +753,7 @@ func wait(ch chan bool) error {
|
||||
|
||||
func TestServerPoolUpdatedWhenRouteGoesAway(t *testing.T) {
|
||||
s1Opts := DefaultOptions()
|
||||
s1Opts.ServerName = "A"
|
||||
s1Opts.Host = "127.0.0.1"
|
||||
s1Opts.Port = 4222
|
||||
s1Opts.Cluster.Host = "127.0.0.1"
|
||||
@@ -771,6 +772,7 @@ func TestServerPoolUpdatedWhenRouteGoesAway(t *testing.T) {
|
||||
chch <- true
|
||||
}
|
||||
nc, err := nats.Connect(s1Url,
|
||||
nats.ReconnectWait(50*time.Millisecond),
|
||||
nats.ReconnectHandler(connHandler),
|
||||
nats.DiscoveredServersHandler(func(_ *nats.Conn) {
|
||||
ch <- true
|
||||
@@ -780,6 +782,7 @@ func TestServerPoolUpdatedWhenRouteGoesAway(t *testing.T) {
|
||||
}
|
||||
|
||||
s2Opts := DefaultOptions()
|
||||
s2Opts.ServerName = "B"
|
||||
s2Opts.Host = "127.0.0.1"
|
||||
s2Opts.Port = s1Opts.Port + 1
|
||||
s2Opts.Cluster.Host = "127.0.0.1"
|
||||
@@ -794,6 +797,7 @@ func TestServerPoolUpdatedWhenRouteGoesAway(t *testing.T) {
|
||||
}
|
||||
|
||||
checkPool := func(expected []string) {
|
||||
t.Helper()
|
||||
// Don't use discovered here, but Servers to have the full list.
|
||||
// Also, there may be cases where the mesh is not formed yet,
|
||||
// so try again on failure.
|
||||
@@ -822,6 +826,7 @@ func TestServerPoolUpdatedWhenRouteGoesAway(t *testing.T) {
|
||||
checkPool([]string{s1Url, s2Url})
|
||||
|
||||
s3Opts := DefaultOptions()
|
||||
s3Opts.ServerName = "C"
|
||||
s3Opts.Host = "127.0.0.1"
|
||||
s3Opts.Port = s2Opts.Port + 1
|
||||
s3Opts.Cluster.Host = "127.0.0.1"
|
||||
|
||||
Reference in New Issue
Block a user