From 4daccca66a62522b2cad25638931ba9fcf05c991 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 28 Jan 2025 16:11:23 -0500 Subject: [PATCH] Fix METADAPT-A deadlock when closing transaction --- metadapta.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/metadapta.go b/metadapta.go index c2616a5..392ee8b 100644 --- a/metadapta.go +++ b/metadapta.go @@ -104,7 +104,7 @@ func (this *a) receive() { this.transLock.Lock() defer this.transLock.Unlock() for _, trans := range this.transMap { - trans.Close() + trans.closeDontUnlist() } clear(this.transMap) }() @@ -163,9 +163,13 @@ type transA struct { } func (this *transA) Close() error { - this.incoming.Close() + err := this.closeDontUnlist() this.parent.unlistTransactionSafe(this.ID()) - return nil + return err +} + +func (this *transA) closeDontUnlist() error { + return this.incoming.Close() } func (this *transA) ID() int64 {