##// END OF EJS Templates
remotefilelog: rework workaround for sshpeer deadlocks...
Valentin Gatien-Baron -
r47417:0509cee3 default
parent child Browse files
Show More
@@ -43,17 +43,19 b' class connectionpool(object):'
43
43
44 if conn is None:
44 if conn is None:
45
45
46 def _cleanup(orig):
46 peer = hg.peer(self._repo.ui, {}, path)
47 # close pipee first so peer.cleanup reading it won't deadlock,
47 if util.safehasattr(peer, '_cleanup'):
48 # if there are other processes with pipeo open (i.e. us).
49 peer = orig.im_self
50 if util.safehasattr(peer, 'pipee'):
51 peer.pipee.close()
52 return orig()
53
48
54 peer = hg.peer(self._repo.ui, {}, path)
49 class mypeer(peer.__class__):
55 if util.safehasattr(peer, 'cleanup'):
50 def _cleanup(self):
56 extensions.wrapfunction(peer, b'cleanup', _cleanup)
51 # close pipee first so peer.cleanup reading it won't
52 # deadlock, if there are other processes with pipeo
53 # open (i.e. us).
54 if util.safehasattr(self, 'pipee'):
55 self.pipee.close()
56 return super(mypeer, self)._cleanup()
57
58 peer.__class__ = mypeer
57
59
58 conn = connection(pathpool, peer)
60 conn = connection(pathpool, peer)
59
61
General Comments 0
You need to be logged in to leave comments. Login now