-
Notifications
You must be signed in to change notification settings - Fork 1
🐛 Add open_timeout to Ruby SDK to prevent hanging connections #187
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
Conversation
Without open_timeout, connection attempts to unreachable servers (e.g., firewall dropping packets) could hang for 60+ seconds. Now fails fast with 10s open timeout + 30s read timeout.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Code ReviewThis PR adds ✅ Positive Aspects
🔍 Observations & Suggestions1. Timeout Value ConsiderationThe
Recommendation: The current values are fine for the common case. If timeout issues arise, consider making these configurable via environment variables (e.g., 2. Error Handling GapThe current error handling at Suggestion: Add a specific check for timeout errors to provide clearer guidance to help users diagnose timeout vs. connection refused vs. 404 issues. 3. Test CoverageThe PR description mentions "Ruby SDK unit tests pass," but looking at Recommendation: Consider adding a test that verifies the timeout parameters are set correctly. While testing actual timeout behavior can be flaky, you could at least verify the configuration with mocking or an intentionally slow test server. Not critical for this PR, but would improve robustness. 4. DocumentationConsider updating the Ruby SDK README (if it exists) to document the timeout behavior and any relevant environment variables. 🐛 No Bugs FoundThe implementation is correct. Net::HTTP's 🔒 SecurityNo security concerns. Timeouts generally improve security by preventing resource exhaustion from hanging connections. ⚡ PerformanceImprovement: This change actually improves performance by failing fast (10s) instead of hanging for 60+ seconds on unreachable servers. SummaryApprove with minor suggestions. The core change is solid and addresses a real problem. The suggestions above are enhancements for future consideration, not blockers for this PR. Key metrics:
|
Separate handling for Net::OpenTimeout and Net::ReadTimeout with actionable guidance for each scenario.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Delete integration_test.rb (used useless 1x1 red pixels) - Update sdk-e2e.yml to run e2e_test.rb with Selenium + Chrome - Add selenium-webdriver to Gemfile - Remove fake integration tests from sdk-unit.yml The e2e tests capture real screenshots from the test-site using Selenium WebDriver, which actually validates the visual testing flow.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Remove unused exception variables in timeout rescues - Add rubocop:disable for metrics on screenshot method - Add webrick gem (removed from stdlib in Ruby 3.0)
Vizzly - Visual Test ResultsCLI Reporter - Waiting for buildNo builds received yet for this pull request. CLI TUI - 1 change needs review
|
Vizzly - Visual Test ResultsCLI Reporter - 14 changes need review
Changes needing review (14)search-no-results · Firefox · 1920×1080 · 0.2% diff filter-failed-only · Firefox · 1920×1080 · 1.1% diff search-homepage · Firefox · 1920×1080 · 0.2% diff fullscreen-viewer · Firefox · 1920×1080 · 5.8% diff bulk-accept-dialog · Firefox · 1920×1080 · 0.5% diff viewer-zoomed-100 · Firefox · 1920×1080 · 0.7% diff ...and 8 more in Vizzly. CLI TUI - Waiting for buildNo builds received yet for this pull request.
|
1 similar comment
Vizzly - Visual Test ResultsCLI Reporter - 14 changes need review
Changes needing review (14)search-no-results · Firefox · 1920×1080 · 0.2% diff filter-failed-only · Firefox · 1920×1080 · 1.1% diff search-homepage · Firefox · 1920×1080 · 0.2% diff fullscreen-viewer · Firefox · 1920×1080 · 5.8% diff bulk-accept-dialog · Firefox · 1920×1080 · 0.5% diff viewer-zoomed-100 · Firefox · 1920×1080 · 0.7% diff ...and 8 more in Vizzly. CLI TUI - Waiting for buildNo builds received yet for this pull request.
|







Summary
open_timeout: 10to Ruby SDK HTTP calls to prevent hanging on unreachable serversWithout this, connection attempts to servers that don't actively refuse (e.g., firewall dropping packets) could hang for 60+ seconds, potentially slowing down CI runs.
Test plan