Skip to content

Commit

Permalink
Fix server termination after timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
krx committed Jul 13, 2017
1 parent 6299764 commit 4b0e9d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import subprocess
import sys
import time
from threading import Thread
from SocketServer import StreamRequestHandler, ThreadingTCPServer

Expand Down Expand Up @@ -60,7 +61,8 @@ def launch_ajl(args):
p = subprocess.Popen(' '.join(ajl_cmd))
try:
with Timeout(args.timeout + 5):
p.communicate()
while p.poll() is None:
time.sleep(0.1)
except TimeoutError:
terminate(p)

Expand Down

0 comments on commit 4b0e9d4

Please sign in to comment.