-
Notifications
You must be signed in to change notification settings - Fork 715
Add blockbuster option to API #5746
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
Conversation
0d04fbd
to
733ed3e
Compare
📝 WalkthroughWalkthroughThis pull request integrates a blocking I/O detection feature into the supervisor. The changes update the startup routine to conditionally activate the blocking detector, add API support for managing the detection state using a new enum and attribute, and extend configuration management with getter/setter and schema validation. A new utility module encapsulates the logic for activating, deactivating, and checking the blocking I/O detection. In addition, corresponding test cases and fixture modifications are introduced to verify the correct behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant SM as Supervisor Main
participant CC as CoreConfig
participant BB as Blockbuster Module
SM ->> CC: Read detect_blocking_io configuration
CC -->> SM: Return boolean value
alt Detection is enabled
SM ->> BB: Call activate_blockbuster()
end
sequenceDiagram
participant Client as API Client
participant API as Supervisor API
participant Config as CoreConfig
participant BB as Blockbuster Module
Client ->> API: Send options request with ATTR_DETECT_BLOCKING_IO value
API ->> API: Validate and interpret the option value
alt Value is ON or ON_AT_STARTUP
API ->> BB: Call activate_blockbuster() [if ON]
API ->> Config: Update configuration (enable detection)
else Value is OFF
API ->> BB: Call deactivate_blockbuster()
API ->> Config: Update configuration (disable detection)
end
API -->> Client: Return response with updated configuration
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (7)
🧰 Additional context used🧬 Code Definitions (2)tests/api/test_supervisor.py (3)
supervisor/api/supervisor.py (3)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (15)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
733ed3e
to
099d76b
Compare
Proposed change
Add an option to enable/disable blockbuster via Supervisor API for use on dev systems to track down any additional blocking I/O in the event loop.
The reason the option is not binary is because
on_at_startup
is a bit dangerous. Blockbuster will cause any attempts to do blocking I/O in the event loop to raise. During startup this will result in a supervisor crash loop that will require some manual effort on the CLI to fix.on
on the other hand is always safe. It may result in individual tasks failing with error logs but Supervisor will keep running. And in the worst case a crash and restart of Supervisor will disable it, you won't get a crash loop.Basically I want to allow someone to run it at startup if they want but I want them to really mean it and be prepared to deal with catastrophic errors 😄
Type of change
Additional information
Checklist
ruff format supervisor tests
)If API endpoints or add-on configuration are added/changed:
Summary by CodeRabbit