refactor: use exponential backoff for dev server retry#5505
Open
Liumingxun wants to merge 2 commits into
Open
Conversation
- Replace fixed 500ms sleep with exponential backoff (250ms base, 2× per attempt, capped at 5s). - This extends the total retry window beyond the original 5-second limit, giving slower-starting dev servers enough time to fully boot without being misjudged or prematurely killed.
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I just changed 500 to 5000 and fixed the startup issue. At least, it seems so. Thanks for the solution |
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.
Replace fixed 500ms sleep with exponential backoff (250ms base, 2× per attempt, capped at 5s).
This extends the total retry window beyond the original 5-second limit, giving slower-starting dev servers enough time to fully boot without being misjudged or prematurely killed.
Description
The previous
preRun()implementation waited for the frontend dev server with a fixed ceiling. This PR replaces the fixed sleep with exponential backoff,Fixes #5504
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor.wails3 doctorDetails
# System┌─────────────────────────────────────────────────────────────┐
| Name | Arch Linux |
| Version | Unknown |
| ID | arch |
| Branding | |
| Platform | linux |
| Architecture | amd64 |
| Desktop Environment | unset |
| NVIDIA Driver | N/A |
| XDG_SESSION_TYPE | unset |
| CPU | AMD Ryzen AI 5 PRO 340 w/ Radeon 840M |
| Memory | 9GB |
└─────────────────────────────────────────────────────────────┘
Build Environment
┌──────────────────────────────────────────────────────────────────────┐
| Wails CLI | v3.0.0-alpha.95 |
| Go Version | go1.26.3 |
| -buildmode | exe |
| -compiler | gc |
| CGO_CFLAGS | |
| CGO_CPPFLAGS | |
| CGO_CXXFLAGS | |
| CGO_ENABLED | 1 |
| CGO_LDFLAGS | |
| DefaultGODEBUG | cryptocustomrand=1,tlssecpmlkem=0,urlstrictcolons=0 |
| GOAMD64 | v1 |
| GOARCH | amd64 |
| GOOS | linux |
└──────────────────────────────────────────────────────────────────────┘
Dependencies
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
| npm | 11.15.0 |
| pkg-config | 2.5.1-1 |
| webkit2gtk (legacy) | [Optional] not installed. Install with: sudo pacman -S webkit2gtk-4.1 |
| webkitgtk-6.0 | 2.52.3-1 |
| gcc | 16.1.1+r12+g301eb08fa2c5-1 |
| gtk3 (legacy) | 1:3.24.52-1 |
| gtk4 | 1:4.22.4-1 |
| docker | *Not installed (optional - for cross-compilation) |
| |
└────────────────────────────────── * - Optional Dependency ──────────────────────────────────┘
Checking for issues
SUCCESS No issues found
Test Configuration
Please paste the output of
wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)