[OPIK-5452] [SDK] feat: warn when runner process exits without blocking#6021
Merged
petrotiurin merged 2 commits intomainfrom Apr 1, 2026
Merged
Conversation
When a user's script exits without a blocking call (e.g., no server framework), the runner never processes jobs. This adds detection via signal tracking — if the process exits cleanly (no SIGTERM/SIGINT), a warning is printed advising the user to use a server framework like uvicorn/Flask (Python) or express/fastify (TypeScript). Implements OPIK-5452 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Consolidate test imports to use only module-level import - Make install_signal_handlers return bool; skip atexit when handlers fail Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
collincunn
approved these changes
Apr 1, 2026
Contributor
Author
|
langchain issues unrelated |
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.
Details
When a user's script exits without a blocking call (e.g., no server framework like uvicorn or express), the runner process terminates before it can process any jobs. This change adds detection by tracking whether shutdown was triggered by a signal (SIGTERM/SIGINT). If the process exits cleanly without a signal, a warning is printed advising the user to use a server framework.
Implemented in both Python and TypeScript SDKs with matching unit tests.
Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
python -m pytest tests/unit/runner/test_activate.py -v(6 tests pass)npx vitest run tests/unit/runner/activate.test.ts(6 tests pass)_shutdown_by_signalflag on SIGTERMDocumentation
N/A