-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(meetings): timeout for cluster discovery request #4004
Conversation
WalkthroughThis pull request introduces a new configuration property, Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
packages/@webex/plugin-meetings/src/reachability/request.ts (1)
49-49
: Add safety checks for the timeout configuration.The timeout implementation looks good and aligns with the PR objectives. However, consider adding safety measures:
- Ensure there's a fallback if the config is undefined
- Validate that the timeout value is positive
Consider updating the implementation:
- timeout: this.webex.config.meetings.reachabilityGetClusterTimeout, + timeout: Math.max(this.webex.config.meetings?.reachabilityGetClusterTimeout ?? 5000, 1000),This ensures:
- Default of 5000ms if config is missing
- Minimum timeout of 1000ms for stability
packages/@webex/plugin-meetings/src/config.ts (1)
98-98
: Add documentation for the new timeout configuration.The new timeout configuration looks good, but consider adding a comment explaining its purpose, similar to other timeout configurations in this file.
+ // Timeout duration for retrieving server clusters during reachability checks reachabilityGetClusterTimeout: 5000,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
packages/@webex/plugin-meetings/src/config.ts
(1 hunks)packages/@webex/plugin-meetings/src/reachability/request.ts
(1 hunks)packages/@webex/plugin-meetings/test/unit/spec/reachability/request.js
(1 hunks)
🔇 Additional comments (3)
packages/@webex/plugin-meetings/test/unit/spec/reachability/request.js (1)
65-75
: LGTM! Comprehensive test assertions
The test assertions correctly verify that:
- The timeout is properly passed to the request parameters
- All other request parameters (method, resource, API, query string) are correctly set
packages/@webex/plugin-meetings/src/reachability/request.ts (1)
Line range hint 32-51
: Verify the configuration setup across the codebase.
Let's ensure the configuration is properly initialized and documented.
✅ Verification successful
Let me check the actual configuration definition and test coverage to make a more informed decision.
Configuration is properly set up and tested
The configuration reachabilityGetClusterTimeout
is:
- Defined in config.ts with a default value of 5000ms
- Properly used in the request implementation
- Covered in unit tests where the timeout value is being verified
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for configuration setup and documentation
# Check for configuration definition
echo "Checking for configuration definition..."
rg -l "reachabilityGetClusterTimeout" packages/@webex/plugin-meetings/src/config.ts
# Check for configuration documentation
echo "Checking for configuration documentation..."
rg -l "reachabilityGetClusterTimeout" packages/@webex/plugin-meetings/README.md
# Check for related test coverage
echo "Checking for test coverage..."
rg -l "reachabilityGetClusterTimeout" packages/@webex/plugin-meetings/test/unit/spec/reachability/
Length of output: 636
Script:
#!/bin/bash
# Check the actual configuration definition
echo "Configuration definition in config.ts:"
rg "reachabilityGetClusterTimeout" packages/@webex/plugin-meetings/src/config.ts -A 2 -B 2
echo "\nTest coverage in request.js:"
rg "reachabilityGetClusterTimeout" packages/@webex/plugin-meetings/test/unit/spec/reachability/request.js -A 2 -B 2
Length of output: 654
packages/@webex/plugin-meetings/src/config.ts (1)
98-98
: Verify the timeout usage across the codebase.
Let's verify that this timeout value is properly utilized in the ReachabilityRequest class and that there are no other hardcoded timeout values for cluster discovery.
✅ Verification successful
Based on the results, I can generate the final response since we have enough information to verify the timeout usage:
Timeout configuration is properly utilized
The timeout value reachabilityGetClusterTimeout
is correctly used in the ReachabilityRequest class and there are no hardcoded timeout values for cluster discovery. Specifically:
- The config value is used in
packages/@webex/plugin-meetings/src/reachability/request.ts
with proper timeout configuration - Tests in
packages/@webex/plugin-meetings/test/unit/spec/reachability/request.js
validate the timeout behavior - No other hardcoded timeout values were found in cluster-related code
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for usage of the new timeout config and any hardcoded timeout values
# Check for usage of the new config
echo "Checking for reachabilityGetClusterTimeout usage:"
rg "reachabilityGetClusterTimeout" -A 3
# Look for potential hardcoded timeout values in cluster-related code
echo -e "\nChecking for hardcoded timeouts in cluster-related code:"
rg -i "cluster.*timeout|timeout.*cluster" -A 3
# Look specifically in the ReachabilityRequest class implementation
echo -e "\nChecking ReachabilityRequest implementation:"
ast-grep --pattern 'class ReachabilityRequest {
$$$
getClusters($_) {
$$$
}
$$$
}'
Length of output: 132679
This pull request is automatically being deployed by Amplify Hosting (learn more). |
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
Sometimes the get clusters requests fails. Given we have a timeout of 3 seconds for reachability itself, we should also restrict the time taken to get the servers for reachability.
by making the following changes
default to 5s timer to get the clusters
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
I certified that
I have read and followed contributing guidelines
I discussed changes with code owners prior to submitting this pull request
I have not skipped any automated checks
All existing and new tests passed
I have updated the documentation accordingly
Make sure to have followed the contributing guidelines before submitting.
Summary by CodeRabbit
New Features
Bug Fixes
Tests