-
Notifications
You must be signed in to change notification settings - Fork 577
UNS-001 [FIX] Add SIGTERM trap handlers for graceful container shutdown #1750
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
base: main
Are you sure you want to change the base?
Conversation
Add bash-level SIGTERM trap handlers to tool and sidecar container entrypoints to prevent premature termination during container shutdown. Changes: - runner.py: Add SIGTERM trap to tool container shell script that logs signal receipt but continues execution - entrypoint.sh: Add SIGTERM handler function, remove 'exec' to allow trap to fire, remove opentelemetry-instrument wrapper The traps intercept SIGTERM from container orchestrators (Docker/K8s) and log the event while allowing the containers to complete naturally via the existing sentinel-based completion detection mechanism. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughUpdates to signal handling in containerized execution. The Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Test ResultsSummary
Runner Tests - Full Report
SDK1 Tests - Full Report
|
|



Summary
Changes
execto allow trap to fire, removeopentelemetry-instrumentwrapperHow it works
When container orchestrators (Docker/Kubernetes) send SIGTERM:
TOOL_EXECUTION_COMPLETEsentinel remains unchangedTest plan
docker kill --signal=SIGTERM <container>logs the trap message🤖 Generated with Claude Code