engine: improve error handling and retry logic in portforwarding. Fixes #2099#2198
Merged
Conversation
nicks
force-pushed
the
nicks/issue2099
branch
from
September 13, 2019 19:50
1b708ec to
80670ee
Compare
maiamcc
approved these changes
Sep 13, 2019
| type PortForwardClient interface { | ||
| Create(ctx context.Context, namespace Namespace, podID PodID, localPort int, remotePort int) (closer func(), err error) | ||
| // Creates a new port-forwarder that's bound to the given context's lifecycle. | ||
| // Then the context is canceled, the port-forwarder will close. |
Contributor
There was a problem hiding this comment.
Suggested change
| // Then the context is canceled, the port-forwarder will close. | |
| // When the context is canceled, the port-forwarder will close. |
| Create(ctx context.Context, namespace Namespace, podID PodID, localPort int, remotePort int) (closer func(), err error) | ||
| // Creates a new port-forwarder that's bound to the given context's lifecycle. | ||
| // Then the context is canceled, the port-forwarder will close. | ||
| Create(ctx context.Context, namespace Namespace, podID PodID, localPort int, remotePort int) (PortForwarder, error) |
Contributor
There was a problem hiding this comment.
Better named NewPortForwarderer or something, no?
landism
approved these changes
Sep 16, 2019
|
|
||
| // Otherwise, repeat the loop, maybe logging the error | ||
| if err != nil { | ||
| logger.Get(ctx).Infof("Error port-forwarding %s: %v", entry.name, err) |
Member
There was a problem hiding this comment.
Maybe add a "Reconnecting..." here, to reduce the chance a user thinks they need to take action
| ns := entry.namespace | ||
| podID := entry.podID | ||
|
|
||
| // TODO(nick): Add exponential retry & backoff |
Member
There was a problem hiding this comment.
is this still relevant, or is it taken care of by startPortForwardLoop?
nicks
force-pushed
the
nicks/issue2099
branch
2 times, most recently
from
September 16, 2019 17:31
a18cc39 to
5970291
Compare
nicks
force-pushed
the
nicks/issue2099
branch
from
September 16, 2019 17:58
5970291 to
54383b9
Compare
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.
Hello @landism, @maiamcc,
Please review the following commits I made in branch nicks/issue2099:
1b708ec (2019-09-13 15:48:00 -0400)
engine: improve error handling and retry logic in portforwarding. Fixes #2099