diff --git a/internal/query/session_core.go b/internal/query/session_core.go index 0bb35e423..4f2cdb358 100644 --- a/internal/query/session_core.go +++ b/internal/query/session_core.go @@ -198,9 +198,9 @@ func (core *sessionCore) attach(ctx context.Context) (finalErr error) { } core.closeOnce = sync.OnceFunc(func() { - core.SetStatus(StatusClosed) defer close(core.done) defer cancelAttach() + core.SetStatus(StatusClosed) }) if markGoroutineWithLabelNodeIDForAttachStream {