Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elog/mod_custom: Spawn processes in background #1295

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

zmedico
Copy link
Member

@zmedico zmedico commented Mar 2, 2024

Since elog_process is typically called while the event loop is running, hold references to spawned processes and wait for them asynchronously, ultimately waiting for them if necessary when the AsyncioEventLoop _close_main method calls _async_finalize via portage.process.run_coroutine_exitfuncs().

ConfigProtectTestCase is useful for exercising this code, and this little make.globals patch can be used to test failure during finalize with this error message:

!!! PORTAGE_ELOG_COMMAND failed with exitcode 1
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -144 +144,2 @@ PORTAGE_ELOG_CLASSES="log warn error"
-PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
+PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo custom"
+PORTAGE_ELOG_COMMAND="/bin/false"

Bug: https://bugs.gentoo.org/925907

@zmedico zmedico force-pushed the bug_925907_async_elog_mod_custom branch from 86f3ac3 to cd3bc8b Compare March 2, 2024 07:00
@zmedico zmedico requested a review from thesamesam March 2, 2024 07:07
@zmedico zmedico force-pushed the bug_925907_async_elog_mod_custom branch 3 times, most recently from 6e57ea1 to 4cb58dd Compare March 2, 2024 09:03
@zmedico zmedico force-pushed the bug_925907_async_elog_mod_custom branch 4 times, most recently from 21ba06f to 4bab53b Compare March 2, 2024 18:29
@zmedico zmedico force-pushed the bug_925907_async_elog_mod_custom branch 2 times, most recently from 1c32a08 to b2a83b6 Compare March 3, 2024 05:12
@zmedico zmedico requested a review from thesamesam March 3, 2024 05:14
@zmedico zmedico force-pushed the bug_925907_async_elog_mod_custom branch 5 times, most recently from 5de64d6 to 675df7a Compare March 3, 2024 06:19
Since elog_process is typically called while the event loop is
running, hold references to spawned processes and wait for them
asynchronously, ultimately waiting for them if necessary when
the AsyncioEventLoop _close_main method calls _async_finalize
via portage.process.run_coroutine_exitfuncs().

ConfigProtectTestCase is useful for exercising this code, and
this little make.globals patch can be used to test failure
during finalize with this error message:

    !!! PORTAGE_ELOG_COMMAND failed with exitcode 1

--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -144 +144,2 @@ PORTAGE_ELOG_CLASSES="log warn error"
-PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
+PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo custom"
+PORTAGE_ELOG_COMMAND="/bin/false"

Bug: https://bugs.gentoo.org/925907
Signed-off-by: Zac Medico <zmedico@gentoo.org>
@zmedico zmedico force-pushed the bug_925907_async_elog_mod_custom branch from 675df7a to c3ebdbb Compare March 3, 2024 06:31
Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gentoo-bot gentoo-bot merged commit c3ebdbb into gentoo:master Mar 3, 2024
12 checks passed
@zmedico zmedico deleted the bug_925907_async_elog_mod_custom branch March 3, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants