mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-20 00:11:27 +00:00
- Timeouts split and env-configurable. RESUME_STREAM_REDIS_TIMEOUT_SEC (hot path, default 100ms) stays tight to protect live streaming. RESUME_STREAM_READ_TIMEOUT_SEC (replay XRANGE, default 1s) is looser since a resume is user-blocking and silently timing out is worse than a brief extra wait. Cross-region / non-colocated Redis setups can override either. - resume-stream now carries a request_id; the server echoes it in resume-stream:replay and the client ignores replies whose id does not match the active request for that message. Prevents reconnect churn where a stale reply could clear a fence belonging to a newer in-flight request. - Documented the concurrent-emitter live ordering caveat in get_event_emitter. Single-emitter flows are safe (streaming loop awaits sequentially). Replay is safe (sorted by seq on read). Overlapping emitters for the same message_id can produce live frames out of seq order — accepting as a known limitation; proper fix needs either a distributed per-message lock or a client reorder buffer, neither justified by the rarity of the scenario. |
||
|---|---|---|
| .. | ||
| main.py | ||
| utils.py | ||