mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
dev-disconnect: add blackhole option.
To reproduce the next bug, I had to ensure that one node keeps thinking it's disconnected, then the other node reconnects, then the first node realizes it's disconnected. This code does that, adding a '0' dev-disconnect modifier. That means we fork off a process which (due to pipebuf) will accept a little data, but when the dev_disconnect file is truncated (a hacky, but effective, signalling mechanism) will exit, as if the socket finally realized it's not connected any more. The python tests hang waiting for the daemon to terminate if you leave the blackhole around; to give a clue as to what's happening in this case I moved the log dump to before killing the daemon. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
e8dadbc0fb
commit
5889ad5fc4
@@ -59,15 +59,15 @@ class TailableProc(object):
|
||||
self.running = True
|
||||
|
||||
def stop(self):
|
||||
self.proc.terminate()
|
||||
self.proc.kill()
|
||||
self.proc.wait()
|
||||
self.thread.join()
|
||||
if self.outputDir:
|
||||
logpath = os.path.join(self.outputDir, 'log')
|
||||
with open(logpath, 'w') as f:
|
||||
for l in self.logs:
|
||||
f.write(l + '\n')
|
||||
self.proc.terminate()
|
||||
self.proc.kill()
|
||||
self.proc.wait()
|
||||
self.thread.join()
|
||||
|
||||
def tail(self):
|
||||
"""Tail the stdout of the process and remember it.
|
||||
|
||||
Reference in New Issue
Block a user