equal
deleted
inserted
replaced
308 if proc is None: |
308 if proc is None: |
309 return |
309 return |
310 def waitpid_timeout_loop(proc = proc, timeout = timeout): |
310 def waitpid_timeout_loop(proc = proc, timeout = timeout): |
311 try: |
311 try: |
312 while proc.poll() is None: |
312 while proc.poll() is None: |
313 time.sleep(1) |
313 time.sleep(.1) |
314 timeout = timeout - 1 |
314 timeout = timeout - .1 |
315 if not timeout: |
315 if timeout <= 0: |
316 GetPLCObjectSingleton().LogMessage( |
316 GetPLCObjectSingleton().LogMessage( |
317 LogLevelsDict["WARNING"], |
317 LogLevelsDict["WARNING"], |
318 "Timeout waiting for {} PID: {}".format(helpstr, str(proc.pid))) |
318 "Timeout waiting for {} PID: {}".format(helpstr, str(proc.pid))) |
319 break |
319 break |
320 except OSError: |
320 except OSError: |
321 # workaround exception "OSError: [Errno 10] No child processes" |
321 # workaround exception "OSError: [Errno 10] No child processes" |
322 pass |
322 pass |
323 Thread(target=waitpid_timeout_loop, name="Zombie hunter").start() |
323 waitpid_timeout_loop() |
324 |
324 |