-
Notifications
You must be signed in to change notification settings - Fork 310
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
Avoid infinite loop in EOF connections #1555
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1555 +/- ##
=======================================
Coverage 36.59% 36.60%
=======================================
Files 88 88
Lines 8462 8466 +4
=======================================
+ Hits 3097 3099 +2
- Misses 4997 4999 +2
Partials 368 368
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future context: the infinite loop is by design, since we don't have a way of knowing from inside the container is there is a process to reverse forward to, we simply keep trying. This is consuming a lot of CPU, thus the ticket to wait a little bit in between retries.
@@ -77,6 +79,7 @@ func (f *forward) start(ctx context.Context) { | |||
} | |||
|
|||
log.Infof("%s -> failed to accept connection: %v", f.String(), err) | |||
<-tick.C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we've only seen this on the reverse, I think we should only do it there for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loops without a delay scare me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will reduce it to 100ms for the forward case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
Signed-off-by: Pablo Chico de Guzman pchico83@gmail.com
Users have reported infinite loops in this code if the error is
EOF