From 62035078ce6a11410323dc662bbd1b199b46c353 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 13 Oct 2021 09:33:33 -0400 Subject: [PATCH] Reduce some loglevels, stick in comment about blocking till next tick --- tractor/_debug.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tractor/_debug.py b/tractor/_debug.py index 62f81d1..b9b470b 100644 --- a/tractor/_debug.py +++ b/tractor/_debug.py @@ -139,7 +139,7 @@ async def _acquire_debug_lock( task_name = trio.lowlevel.current_task().name - log.pdb( + log.debug( f"Attempting to acquire TTY lock, remote task: {task_name}:{uid}" ) @@ -187,7 +187,7 @@ async def _acquire_debug_lock( if ( not stats.owner ): - log.pdb(f"No more tasks waiting on tty lock! says {uid}") + log.debug(f"No more tasks waiting on tty lock! says {uid}") _no_remote_has_tty.set() _no_remote_has_tty = None @@ -272,7 +272,7 @@ async def _hijack_stdin_for_child( if isinstance(err, trio.Cancelled): raise finally: - log.pdb("TTY lock released, remote task:" + log.debug("TTY lock released, remote task:" f"{task_name}:{subactor_uid}") return "pdb_unlock_complete" @@ -315,8 +315,6 @@ async def _breakpoint( try: async with get_root() as portal: - log.pdb('got portal') - # this syncs to child's ``Context.started()`` call. async with portal.open_context( @@ -561,6 +559,12 @@ async def maybe_wait_for_debugger() -> None: 'Root polling for debug') await trio.sleep(0.01) + # TODO: could this make things more deterministic? + # wait to see if a sub-actor task will be + # scheduled and grab the tty lock on the next + # tick? + # await trio.testing.wait_all_tasks_blocked() + debug_complete = _no_remote_has_tty if ( (debug_complete and