WebSocket MARS Server Support with Backward Compatibility#339
Open
WebSocket MARS Server Support with Backward Compatibility#339
Conversation
…ate error handling
…ect MARS client type based on configuration
…cing server list retrieval and improving error handling
…et support for shares client
…enhanced output parsing
…or and add corresponding tests
…and adjust tests accordingly
…y with new AbstractCdsAdaptor API
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.
Support WebSocket MARS Server with Backward Compatibility
Summary
Adds support for WebSocket-based MARS client using shared filesystem access, solving pipe-related errors in high-concurrency scenarios while maintaining full backward compatibility with existing deployments.
Problem
The current pipe-based MARS client can experience issues under high concurrency:
Solution
Implements modal behavior controlled by
MARS_USE_SHARESenvironment variable:MARS_USE_SHARES=false(default): Uses existing pipe-based clientMARS_USE_SHARES=true: Uses new WebSocket client with:Key Changes
1. New WebSocket Client Implementation
execute_mars_shares(): New function implementing WebSocket-based MARS requestsget_mars_server_list_ws(): Converts HTTP pipe URLs to WebSocket URLs2. Version-Aware Backward Compatibility
WebSocket mode requires both:
MARS_USE_SHARES=trueenvironment variablecads-mars-server >= 0.3.0installedNew functions:
_check_cads_mars_server_supports_websocket(): Detects cads-mars-server version_should_use_websocket_mode(): Determines which client to useHandles all scenarios:
base_versionparsing3. Enhanced Logging
Backward Compatibility
No breaking changes:
Configuration
Environment Variables
Some environmental variables have been added.
The existing lists of servers fetched from files are still usable and there is no need for specifying the ws protocol as it will be enforced as well as the port.
Related PRs
cads-mars-server