Skip to content
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

fix proxy retry loop #635

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

farmergreg
Copy link
Contributor

@farmergreg farmergreg commented Aug 26, 2024

This addresses two bugs:

  1. The loop could exit with an error condition present and fail to inform the user.
  2. On Windows 11, syscall.ECONNREFUSED is not returned. Instead we receive net.OpError with a message similar to:

unable to reach app: Get "http://localhost:7000/": dial tcp [::1]:7000: connectex: No connection could be made because the target machine actively refused it.

The Fix:
Since the retry loop is short, we retry until no error happens. If an error does occur, we inform the user.

This addresses two bugs:
1) The loop could exit with an error condition present and fail to
   inform the user.
2) On Windows 11, syscall.ECONNREFUSED is not returned. Instead we
   receive net.OpError with a message similar to:

"unable to reach app: Get "http://localhost:7000/": dial tcp [::1]:7000: connectex: No connection could be made because the target machine actively refused it."

The Fix:
Since the retry loop is short; just 1 second maximum, we retry until no
error happens. If an error does occur, we inform the user.
@cosmtrek cosmtrek merged commit f4f7c3d into air-verse:master Sep 21, 2024
5 of 7 checks passed
jesses-code-adventures pushed a commit to jesses-code-adventures/air that referenced this pull request Sep 25, 2024
This addresses two bugs:
1) The loop could exit with an error condition present and fail to
   inform the user.
2) On Windows 11, syscall.ECONNREFUSED is not returned. Instead we
   receive net.OpError with a message similar to:

"unable to reach app: Get "http://localhost:7000/": dial tcp [::1]:7000: connectex: No connection could be made because the target machine actively refused it."

The Fix:
Since the retry loop is short; just 1 second maximum, we retry until no
error happens. If an error does occur, we inform the user.
@istyf istyf mentioned this pull request Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants