Reduce some loglevels, stick in comment about blocking till next tick

immediate_remote_cancels
Tyler Goodlet 2021-10-13 09:33:33 -04:00
parent 893bad72d5
commit 62035078ce
1 changed files with 9 additions and 5 deletions

View File

@ -139,7 +139,7 @@ async def _acquire_debug_lock(
task_name = trio.lowlevel.current_task().name task_name = trio.lowlevel.current_task().name
log.pdb( log.debug(
f"Attempting to acquire TTY lock, remote task: {task_name}:{uid}" f"Attempting to acquire TTY lock, remote task: {task_name}:{uid}"
) )
@ -187,7 +187,7 @@ async def _acquire_debug_lock(
if ( if (
not stats.owner 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.set()
_no_remote_has_tty = None _no_remote_has_tty = None
@ -272,7 +272,7 @@ async def _hijack_stdin_for_child(
if isinstance(err, trio.Cancelled): if isinstance(err, trio.Cancelled):
raise raise
finally: finally:
log.pdb("TTY lock released, remote task:" log.debug("TTY lock released, remote task:"
f"{task_name}:{subactor_uid}") f"{task_name}:{subactor_uid}")
return "pdb_unlock_complete" return "pdb_unlock_complete"
@ -315,8 +315,6 @@ async def _breakpoint(
try: try:
async with get_root() as portal: async with get_root() as portal:
log.pdb('got portal')
# this syncs to child's ``Context.started()`` call. # this syncs to child's ``Context.started()`` call.
async with portal.open_context( async with portal.open_context(
@ -561,6 +559,12 @@ async def maybe_wait_for_debugger() -> None:
'Root polling for debug') 'Root polling for debug')
await trio.sleep(0.01) 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 debug_complete = _no_remote_has_tty
if ( if (
(debug_complete and (debug_complete and