From 453967fad865a60830f789889f151c12d0fb28a4 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 24 Oct 2022 10:31:29 +0200 Subject: [PATCH] Stream pool and synctree fixes --- common/commonspace/syncservice/streampool.go | 8 ++++---- common/commonspace/synctree/synctree.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/commonspace/syncservice/streampool.go b/common/commonspace/syncservice/streampool.go index 89572992..34f2c392 100644 --- a/common/commonspace/syncservice/streampool.go +++ b/common/commonspace/syncservice/streampool.go @@ -98,7 +98,7 @@ func (s *streamPool) SendSync( delete(s.waiters, msg.ReplyId) s.waitersMx.Unlock() - log.With("trackingId", msg.ReplyId).Error("time elapsed when waiting") + log.With("replyId", msg.ReplyId).Error("time elapsed when waiting") err = ErrSyncTimeout case reply = <-waiter.ch: if !delay.Stop() { @@ -226,17 +226,17 @@ func (s *streamPool) readPeerLoop(peerId string, stream spacesyncproto.SpaceStre s.messageHandler(stream.Context(), peerId, msg) return } - log.With("trackingId", msg.ReplyId).Debug("getting message with tracking id") + log.With("replyId", msg.ReplyId).Debug("getting message with reply id") s.waitersMx.Lock() waiter, exists := s.waiters[msg.ReplyId] if !exists { - log.With("trackingId", msg.ReplyId).Debug("tracking id not exists") + log.With("replyId", msg.ReplyId).Debug("reply id not exists") s.waitersMx.Unlock() s.messageHandler(stream.Context(), peerId, msg) return } - log.With("trackingId", msg.ReplyId).Debug("tracking id exists") + log.With("replyId", msg.ReplyId).Debug("reply id exists") delete(s.waiters, msg.ReplyId) s.waitersMx.Unlock() diff --git a/common/commonspace/synctree/synctree.go b/common/commonspace/synctree/synctree.go index 863c3998..c8e17602 100644 --- a/common/commonspace/synctree/synctree.go +++ b/common/commonspace/synctree/synctree.go @@ -125,7 +125,7 @@ func BuildSyncTreeOrGetRemote(ctx context.Context, id string, deps BuildDeps) (t } resp, err := deps.StreamPool.SendSync(peerId, objMsg) - if resp != nil { + if err != nil { return } msg = &treechangeproto.TreeSyncMessage{}