justinpark opened a new pull request, #42814: URL: https://github.com/apache/superset/pull/42814
### SUMMARY Adds `MCP_STATELESS_HTTP` (default True, matching current behavior) to make FastMCP's streamable-HTTP session mode configurable instead of hardcoded. In stateless mode, each request's transport is torn down as soon as that single HTTP round trip finishes while the tool call keeps running in the background; if a client gives up on a still-running call and the tool tries to send another progress notification, it hits the now-closed transport and crashes the session, disconnecting other concurrent clients on the same worker. Setting this to False keeps the session (and its transport) alive for the session's lifetime, fixing the crash — confirmed via a live A/B repro where the identical client-disconnect trigger crashed under True and completed cleanly under False. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF | Result -- | -- | -- stateless_http=True | BrokenResourceError → ToolError crash (same category as production) stateless_http=False | All 6 notifications sent successfully, completed with success=True after 3.58s ### TESTING INSTRUCTIONS - [x] Full tests/unit_tests/mcp_service/ suite: 3135 passed, same 5 pre-existing failures as before this change (verified unrelated via git stash) - [x] test_mcp_e2e_smoke.py updated to reflect the new config-driven default and explicitly pin the ASGI app under test to stateless_http=False - [x] Live dev-instance repro: identical generate_chart call with a client disconnecting mid-execution crashes with BrokenResourceError/ToolError under stateless_http=True, completes successfully (all progress notifications delivered) under stateless_http=False ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
