#9535 feat: New `--timeout` option for `meltano run`
Pull request opened by
edgarrmondragon
## Description
SSIA.
## Related Issues
•
#8080
• Closes
#8716
## Summary by Sourcery
Add a new --timeout option to the meltano run command to limit pipeline execution time with support for an environment variable, enforce it via asyncio.wait_for, and gracefully terminate in-flight blocks on timeout.
New Features:
• Introduce --timeout option (with MELTANO_RUN_TIMEOUT envvar) for meltano run to cap pipeline duration
Enhancements:
• Wrap run execution in asyncio.wait_for and handle TimeoutError by logging, tracking, and raising a CliError
• Implement graceful termination of the current block in _run_blocks on cancellation
• Extend ExtractLoadBlocks.terminate and SingerBlock.stop to support graceful shutdown and cancel output futures
Documentation:
• Document the --timeout option and MELTANO_RUN_TIMEOUT envvar in the CLI reference
Tests:
• Add tests for run timeout scenarios including success, timeout exceeded, plugin commands, environment variable, and zero-value rejection
• Update EventMatcher in tests with a find_first_event helper and adjust assertions accordingly
meltano/meltano