Fix concurrent access issues causing Bad Gateway errors#9
Merged
BenCretois merged 1 commit intomainfrom Sep 26, 2025
Merged
Conversation
Major improvements for multi-user access: **Root Cause Analysis:** - Streamlit @st.cache_data with _self parameter was causing cache key conflicts - Shared temporary file dictionary caused resource conflicts between sessions - No proper session isolation for concurrent users **Solutions Implemented:** 1. **Enhanced Cache Isolation:** - Added unique cache keys based on file paths and parameters - Maintains instance method pattern while fixing cache conflicts - Each user session gets properly isolated cache entries 2. **Session-Specific Temp Files:** - Added session-specific prefixes for temporary files - Prevents file conflicts between concurrent users - Auto-cleanup remains intact per session 3. **Session Management:** - Added UUID-based session IDs in main app - Improved Streamlit configuration for concurrent users - Better connection handling and caching settings 4. **Service Layer Fixes:** - Fixed DataService, AudioService, and SiteMetadataService - Maintained backward compatibility with existing API - Proper error handling for concurrent operations **Configuration Updates:** - Enhanced .streamlit/config.toml for better concurrent handling - Disabled usage stats to reduce potential race conditions - Improved message size and upload limits **Impact:** - ✅ Eliminates Bad Gateway errors when multiple users access dashboard - ✅ Each user session is properly isolated - ✅ Maintains all existing functionality - ✅ Better performance under concurrent load - ✅ Backward compatible API The dashboard now supports multiple concurrent users without conflicts!
3a36147 to
e238fe9
Compare
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.
Major improvements for multi-user access:
Root Cause Analysis:
Solutions Implemented:
Enhanced Cache Isolation:
Session-Specific Temp Files:
Session Management:
Service Layer Fixes:
Configuration Updates:
Impact:
The dashboard now supports multiple concurrent users without conflicts!