subsystem-summary-of-process
Process Subsystem — Technical Summary
Overview
The process subsystem provides asynchronous subprocess management for stellar-core, wrapping platform-specific process spawning (POSIX posix_spawnp and Windows CreateProcess) behind a unified asio-integrated interface. It enables running external commands (e.g., history archival tools like gzip, gunzip, curl) asynchronously, with configurable concurrency limits, output file capture, graceful shutdown, and process lifecycle tracking. No facilities exist for reading/writing subprocess I/O ports — this is strictly for "run a command, wait to see if it worked."
Key Files
- ProcessManager.h — Abstract interface
ProcessManagerand theProcessExitEventclass for async process completion notification. - ProcessManagerImpl.h / ProcessManagerImpl.cpp — Concrete implementation of
ProcessManager; contains all lifecycle management, platform-specific spawning, signal handling, and shutdown logic. - PosixSpawnFileActions.h / PosixSpawnFileActions.cpp — POSIX-only RAII wrapper around
posix_spawn_file_actions_tfor redirecting subprocess stdout to a file.
Key Classes and Data Structures
ProcessManager (abstract, inherits std::enable_shared_from_this<ProcessManager>, NonMovableOrCopyable)
The public interface for subprocess management. One ProcessManager exists per Application instance, created via the static factory ProcessManager::create(Application&).
More from stellar/stellar-core
running-tests
running tests at various levels from smoke tests to full suite to randomized tests
1subsystem-summary-of-test
read this skill for a token-efficient summary of the test subsystem
1subsystem-summary-of-scp
read this skill for a token-efficient summary of the scp subsystem
1running-make-to-build
how to run make correctly to get a good build, and otherwise understand the build system
1subsystem-summary-of-history
read this skill for a token-efficient summary of the history subsystem
1subsystem-summary-of-invariant
read this skill for a token-efficient summary of the invariant subsystem
1