Repository navigation
Require shared storage for HTTP streaming callbacks - #4099
Merged
Merged
Conversation
An app with a streaming callback that runs over HTTP and no shared storage now fails at server setup with StreamCallbackError, instead of falling back to one connection per stream: that fallback works locally but breaks once deployed. Streaming callbacks over WebSocket on a backend that supports it (FastAPI, Quart) do not need shared storage.
Contributor
Dash performance benchmarks✅ all within thresholds
growth = late-third / early-third per-op time; ~1 is flat, a large value means the per-op cost scales with accumulated state. machine scale vs baseline: 1.03x - divided out of the baseline ratios so they compare like for like (the absolute warn/fail ceilings are left un-scaled); calibrated on |
|
KoolADE85
approved these changes
Oct 29, 2026
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.



Follow-up to #4095. With shared storage off, a streaming callback over HTTP fell back to one connection per stream. That works on a laptop, then breaks once deployed (browsers cap connections per host), so it gave false confidence. Now it fails loudly, the same way locally and when deployed.
Changes
_setup_serverraisesStreamCallbackErrorwhen the app has streaming callbacks that run over HTTP and no shared storage. The message names the callbacks and how to fix it:shared_storage=,DASH_SHARED_STORAGE, or WebSocket. It runs next to the background-callback validation, so every request fails with the same error until it's fixed.websocket_callbacks=Trueorwebsocket=True) are exempt only on a backend that serves WebSockets (FastAPI, Quart). On Flask those flags still mean HTTP, so the check applies.Dashdocstring,.ai/ARCHITECTURE.md) no longer describe the fallback. The doc notes that browsers withoutSharedWorkerstill stream WebSocket-app callbacks over HTTP; the server can't detect that.Tests
tests/streaming/conftest.pysetsDASH_SHARED_STORAGE=local, so streaming tests run with shared storage unless they pass their own.