mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-14 14:16:39 +00:00
check-memory: if the child process fails to start, shut down instead of hanging forever
This commit is contained in:
parent
7bb7d76d9d
commit
32f25f33e3
@ -183,6 +183,8 @@ this file are ignored.
|
||||
# control.furl file to appear.
|
||||
furl_file = os.path.join(clientdir, "control.furl")
|
||||
def _check():
|
||||
if pp.ended:
|
||||
raise RuntimeError("process ended while waiting for startup")
|
||||
return os.path.exists(furl_file)
|
||||
d = self.poll(_check, 0.1)
|
||||
# once it exists, wait a moment before we read from it, just in case
|
||||
@ -333,11 +335,14 @@ this file are ignored.
|
||||
|
||||
|
||||
class ClientWatcher(protocol.ProcessProtocol):
|
||||
ended = False
|
||||
def outReceived(self, data):
|
||||
print "OUT:", data
|
||||
def errReceived(self, data):
|
||||
print "ERR:", data
|
||||
def processEnded(self, reason):
|
||||
print "PROCESSENDED", reason
|
||||
self.ended = True
|
||||
self.d.callback(None)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user