-
Notifications
You must be signed in to change notification settings - Fork 33
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
restart when manager and agent cannnot connect to kafka #1249
Conversation
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.
As we discussed offline, let us add a back door in case we do not handle all error cases. FYI @ldpliu
|
c6023b8
to
ccd1009
Compare
|
||
errorCount++ | ||
if errorCount >= transportFailureThreshold { | ||
log.Panicf("Thransport producer error > 10 in 5 minutes, error: %v", ev) |
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.
s/Thransport/transport
@@ -212,6 +215,16 @@ func handleProducerEvents(log *zap.SugaredLogger, eventChan chan kafka.Event) { | |||
log.Warnw("Transport producer client error, ignore it for most cases", "error", ev) | |||
} else { | |||
log.Warnw("Thransport producer client error", "error", ev) |
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.
s/Thransport/transport
agent/cmd/main.go
Outdated
@@ -124,6 +124,8 @@ func parseFlags() *configs.AgentConfig { | |||
"The agent running namespace, also used as leader election namespace") | |||
pflag.IntVar(&agentConfig.SpecWorkPoolSize, "consumer-worker-pool-size", 10, | |||
"The goroutine number to propagate the bundles on managed cluster.") | |||
pflag.IntVar(&agentConfig.TransportConfig.FailureThreshold, "transport-failure-threshold", 10, | |||
"Restart pod when tansport error count > transport-failure-threshold in 5 mins.") |
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.
Restart the pod if the transport error count exceeds the transport-failure-threshold within 5 minutes
} else { | ||
log.Warnw("Thransport producer client error", "error", ev) | ||
log.Warnw("thransport producer client error", "error", ev) |
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.
s/thransport/transport
|
||
errorCount++ | ||
if errorCount >= transportFailureThreshold { | ||
log.Panicf("thransport producer error > 10 in 5 minutes, error: %v", ev) |
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.
s/thransport/transport
Signed-off-by: ldpliu <[email protected]> Signed-off-by: root <[email protected]>
|
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clyang82, ldpliu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Related issue(s)
https://issues.redhat.com/browse/ACM-14562
Fixes #
Tests
make unit-tests
.make integration-test
.make e2e-test-all
.