Skip to content

Commit 5ea5ff8

Browse files
committed
code: wait 30s for clean exit, chg warn to debug, upversion
1 parent c8c92b1 commit 5ea5ff8

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

munet/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ async def cleanup_pid(self, pid, kill_pid=None):
408408
if kill_pid is None:
409409
kill_pid = pid
410410

411-
for sn in (signal.SIGTERM, signal.SIGKILL):
411+
for sn in (signal.SIGHUP, signal.SIGKILL):
412412
self.logger.debug(
413413
"%s: %s %s (wait %s)", self, signal.Signals(sn).name, kill_pid, pid
414414
)
@@ -420,15 +420,15 @@ async def cleanup_pid(self, pid, kill_pid=None):
420420
return
421421

422422
# try each signal, waiting 15 seconds for exit before advancing
423-
wait_sec = 20
423+
wait_sec = 30
424424
self.logger.debug("%s: waiting %ss for pid to exit", self, wait_sec)
425425
for _ in Timeout(wait_sec):
426426
try:
427427
status = os.waitpid(pid, os.WNOHANG)
428428
if status == (0, 0):
429429
await asyncio.sleep(0.1)
430430
else:
431-
self.logger.info("pid %s exited status %s", pid, status)
431+
self.logger.debug("pid %s exited status %s", pid, status)
432432
return
433433
except OSError as error:
434434
if error.errno == errno.ECHILD:

munet/native.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ async def get_proc_child_pid(self, p):
333333
spid = str(p.pid)
334334
for _ in Timeout(4):
335335
if p.returncode is not None:
336-
self.logger.warning(
337-
"%s: exit before getting child of proc: %s", self, p
338-
)
336+
self.logger.debug("%s: proc %s exited before getting child", self, p)
339337
return None
340338

341339
rc, o, e = await commander.async_cmd_status(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "munet"
3-
version = "0.12.8"
3+
version = "0.12.9"
44
description = "A package to facilitate network simulations"
55
authors = ["Christian Hopps <[email protected]>"]
66
license = "GPL-2.0-or-later"

0 commit comments

Comments
 (0)