Fix METADAPT-A deadlock when closing transaction
This commit is contained in:
		
							parent
							
								
									4647f91abe
								
							
						
					
					
						commit
						4daccca66a
					
				
							
								
								
									
										10
									
								
								metadapta.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								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 { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user