Skip to content

Conversation

ekzhang
Copy link
Owner

@ekzhang ekzhang commented Apr 8, 2022

This PR improves stability and user experience by terminating, instead of waiting indefinitely, in the following cases:

Kill connections in the shared::proxy() function when either duplex stream direction terminates, rather than both.

For example, if a user starts a connection at bore.pub:12345 that forwards a raw HTTP/2 connection to their localhost port, and they kill the web server at that port, then previously future HTTP/2 requests in the same browser session to bore.pub:12345 would hang indefinitely because they would reuse the same TCP stream. With this change, the TCP stream would be closed immediately instead.

Adds a timeout to initial protocol messages.

Initial protocol messages should be expected immediately, so if they are not sent, that indicates a network partition or other issue. This adds a timeout to such messages. It catches cases such as when the -s flag is passed to bore local even when the server is configured to not use a secret. Previously this case would wait indefinitely for a server challenge.

Adds a timeout to initial TCP connections.

This fixes issues such as typo in the TCP connection string. Previously running something like bore local 5000 --to google.com would wait indefinitely for a connection to google.com:7835. Now it terminates gracefully with an error.

@ekzhang ekzhang changed the title Improve stability around long waits on errors Improve stability by exiting instead of waiting indefinitely in several cases Apr 8, 2022
@ekzhang ekzhang changed the title Improve stability by exiting instead of waiting indefinitely in several cases Improve stability by exiting immediately on common errors Apr 8, 2022
@ekzhang ekzhang merged commit 2d0dcf9 into main Apr 8, 2022
@ekzhang ekzhang deleted the ekzhang/kill-missing branch April 8, 2022 19:55
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.

1 participant