Introduce programmatic popen and run execution layers with distributed process controllers - #129
Merged
dmitry-lipetsk merged 30 commits intoSep 15, 2026
Conversation
OsOperations::popen runs process and returns a controller object - OsProcessController. Also - ExecTimeoutException is added.
…/137" This reverts commit 81117d7.
We will use response file to get a result code of user command.
It is used for external configuring of remote_ops__popen__handshake_timeout.
New tests are added
dmitry-lipetsk
force-pushed
the
D20260914_001--os_ops
branch
from
September 15, 2026 18:39
0c3bcc4 to
0b521b6
Compare
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.
Description
This PR refactors the core process execution layer in
testgres.os_opsto transition from the legacyexec_commandto a modern, decoupled abstraction model utilizingpopenandrun. This layer guarantees cross-platform uniformity, preventing descriptor leaks and handling complex environmental differences (such as standard library variations in Alpine or specific hardware constraints).Core Enhancements
Uniform Interface Layer (
OsProcessController&OsCommandResult)LocalProcessController,RemoteProcessController) to provide full API symmetry with standardsubprocess.Popen.io.IOBase) for all standard I/O pipes, descriptors, and streams.Robust Multi-stage Remote Handshake Mechanism
RemoteOperations::popenaround a multi-stage POSIX-compliant script wrapper.time.monotonic()loops to execute state handshakes via remote transient tracking files (pid_file,rc_file).255exit status side-effects, ensuring exact signal propagation (137forSIGKILL,143forSIGTERM).Prevention of Deadlocks and Resource Leaks
__enter__/__exit__) across controllers to automate cleanup procedures.__init__sequences combined with defensive__del__destructors to force-terminate dangling SSH client pipes and avoid active zombie nodes.Emergency Configuration Overrides (
OsOperationStaticConfig)os.environoverhead.TESTGRES_OS_OPS_CFG__REMOTE_OPS__POPEN__HANDSHAKE_TIMEOUTenvironment variable option (defaulting to 10.0s, with a valid range up to 4 hours) to prevent unexpected test flakes under high-density infrastructure loads (e.g., Elbrus/e2k compilation farms)._debug_printdiagnostics to prevent silent misconfigurations in CI/CD environments.Testing Suite Summary
text,encoding,shell,input, streams).What's Next
This PR lays the public contract for user space execution. Internal utilities (e.g.,
read_binary,mkstemp,remove_file) will be isolated onto private_transport_popenand_transport_runwheels in a follow-up patch to cleanly decouple internal system tasks from user pipelines.