From 5084c96daa8ce193ed3c9afbfb12a6de02aaa25a Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Thu, 02 Apr 2026 10:29:14 +0000 Subject: [PATCH] knotmirror: kill subscription on failure So that we can actually know the runtime subscription status and resubscribe on requestCrawl Signed-off-by: Seongmin Lee --- knotmirror/knotstream/slurper.go | 6 ++++++ 1 file(s) changed, 6 insertion(s)(+), 0 deletion(s)(-) diff --git a/knotmirror/knotstream/slurper.go b/knotmirror/knotstream/slurper.go --- a/knotmirror/knotstream/slurper.go +++ b/knotmirror/knotstream/slurper.go @@ -116,6 +116,12 @@ func (s *KnotSlurper) subscribeWithRedialer(ctx context.Context, host models.Host, sub *subscription) { l := s.logger.With("host", host.Hostname) + defer func() { + s.subsLk.Lock() + defer s.subsLk.Unlock() + + delete(s.subs, host.Hostname) + }() dialer := websocket.Dialer{ HandshakeTimeout: time.Second * 5, -- tangled.sh