Conversation
spawn(), which conducts a send/expect process is blocking due to the abscence of async_=True to pexpect.expect() within the method's main send/expect loop. This is undesirable due the presence of other ongoing initialization coroutines, since it will block their progress for the entire time needed to complete either the single nodes send/expect loop (or wait for it to timeout). This is particularly problematic in cases where multiple VMs requiring custom console expect/send prompts are required (e.g. routers). Since each QEMU VM sets up both console logging and completes an expect/send loop without yielding control to the coroutine of the other QEMU VMs, only one VM can ever have logging configured (and thus advance in an expect/send loop) at any given time. Not only is this inefficient given that all QEMU VMs are running and waiting for input, but this can be fatal if console logging is not set up on each VM in time. If some mandatory console output is missed, then there is no way to recover and the setup of the QEMU VM will time out. By changing spawn() such that is awaits for pexpect.expect(), control can be properly passed to coroutines of other QEMU VM nodes. This allows for logging to be set up on all nodes immediately and for independent progress to be made in each VM's expect/send loop. Signed-off-by: Liam Brady <lbrady@labn.net>
liambrady
force-pushed
the
liambrady/qemu_pexpect_async
branch
3 times, most recently
from
May 2, 2025 19:49
295d592 to
c2d64de
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 58.84% 59.10% +0.26%
==========================================
Files 19 19
Lines 5729 5732 +3
==========================================
+ Hits 3371 3388 +17
+ Misses 2358 2344 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
For some reason, PopenSpawn cannot be mixed with .expect() when async_=True. This appears to be an upstream issue with pexpect with no known fix. Signed-off-by: Liam Brady <lbrady@labn.net>
liambrady
force-pushed
the
liambrady/qemu_pexpect_async
branch
from
May 5, 2025 13:34
c2d64de to
987a634
Compare
Contributor
Author
|
See #58 for the updated PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DON'T MERGE
This PR contains updates for shell_expect() that makes it async, however, such leads to an upstream pexpect OSError (bad socket descriptor). The specific test cases have been removed in this commit in order to test how much code coverage is lost.