-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[ios] Time out packager liveness check after 10s #31367
Conversation
|
Base commit: 8f3ffcf |
Base commit: 8f3ffcf |
@charlesbdudley has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@charlesbdudley merged this pull request in c0e0446. |
DescriptionPosting this here in case it helps anyone - I ran into an issue where this change was causing the ios simulator to fail to connect to metro. Changing the timeout back to 10 seconds fixed the issue. From what we understand, the simulator was making a request to metro which was timing out, but we were unable to figure out why the request was taking so long. macOs 13.1 Output of npx react-native infowarn Package React Native Version0.67.5 and above Steps to reproduceHard to reproduce. Other people on my team were using the exact same setup, but I was the only one who encountered the issue. Snack, code example, screenshot, or link to a repository |
Summary
isPackagerRunning
check on iOS makes a http request to packager's /status endpoint to check if it's alive... The problem is if the packager can't be reached, but doesn't error out immediately. This can happen, for example, if running the app on device, and host computer's firewall doesn't allow a :8081 connection. In that case, the request will never succeed or fail until default timeout of 60s. It makes debugging the underlying issue quite unbearable. It's hard for me to imagine a legitimate packager connection that wouldn't respond in less than a second, so I propose a conservative timeout of 10sChangelog
[iOS] [Fixed] - Don't hang app for 60s if packager can't be reached
Test Plan
Checked my app in dev mode to see if packager connects properly.