Commit 634eab7c authored by Gero Müller's avatar Gero Müller
Browse files

fix infinite loop in disconnect

parent c5483d36
......@@ -843,7 +843,7 @@ class WatchService(object):
for subscriber in self.subscriber_buffer[:]:
subscriber.flush(False)
for subscriber in self.subscribers.items():
for subscriber in self.subscribers.values():
subscriber.destroy()
self.monitor.remove_all_watches()
......
......@@ -153,7 +153,7 @@ class LocalConnectionImpl(object):
_local_connection_feeder = None
def __init__(self, command, **kwargs):
if not sys.platform.startswith("java"):
if command[0] == "python" and not sys.platform.startswith("java"):
command[0] = sys.executable
logger.info("local connection: %s" % " ".join(command))
self.__proc = subprocess.Popen(command, stdin=subprocess.PIPE,
......
......@@ -343,6 +343,14 @@ stdout = sys.stdout
# TODO: redirect stdout and err to temporary files
sys.stdout = file("/dev/null", 'ab+', 0)
# set stderr non-blocking to prevent dead-lock
try:
import fnctl
fl = fcntl.fcntl(sys.stderr, fcntl.F_GETFL)
fcntl.fcntl(sys.stderr, fcntl.F_SETFL, fl | os.O_NONBLOCK)
except:
logger.exception("nonblock stderr")
# sys.stderr = file(join_path(base, 'rpycd.err'), 'ab+', 0)
# main_loop(sys.stdin, stdout)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment