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(state): clean topo when stop by EOF #3304

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fvt/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (s *ConnectionTestSuite) TestSinkPing() {
"measurement": "test",
},
timeout: true,
err: "{\"error\":1000,\"message\":\"Get \\\"http://test.com/test/ping?parseTime=true&wait_for_leader=10s\\\": dial tcp 127.0.0.1:80: connectex: No connection could be made because the target machine actively refused it.\"}\n",
err: "\"error\":1000",
},
{
name: "influx2",
Expand All @@ -483,7 +483,7 @@ func (s *ConnectionTestSuite) TestSinkPing() {
"measurement": "test",
},
timeout: true,
err: "i/o timeout",
err: "error connecting to influxdb2",
},
}
prefix := "metadata/sinks/connection"
Expand Down
12 changes: 6 additions & 6 deletions internal/topo/rule/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ func (s *State) runTopo(ctx context.Context, tp *topo.Topo, rs *def.RestartStrat
}
}
})
if s.topology != nil {
s.topoGraph = s.topology.GetTopo()
keys, values := s.topology.GetMetrics()
s.stoppedMetrics = []any{keys, values}
s.topology = nil
}
if err != nil { // Exit after retries
s.logger.Error(err)
if s.topology != nil {
s.topoGraph = s.topology.GetTopo()
keys, values := s.topology.GetMetrics()
s.stoppedMetrics = []any{keys, values}
s.topology = nil
}
s.transit(StoppedByErr, err)
} else {
s.transit(Stopped, err)
Expand Down
Loading