Fix panic on influx shutdown.
Influx was shutdown before Poseidon was terminated. In that mean time the Profiling data has been written. Also in that mean time, a periodical influx event triggers a panic since influx is already shutdown. We implemented two changes, each fixing this scenario.
This commit is contained in:

committed by
Sebastian Serth

parent
5fe9b686c2
commit
a4599f2cf9
@ -82,6 +82,7 @@ func InitializeInfluxDB(db *config.InfluxDB) (cancel func()) {
|
||||
// Flush the influx client on shutdown.
|
||||
cancel = func() {
|
||||
influxClient.Flush()
|
||||
influxClient = nil
|
||||
client.Close()
|
||||
}
|
||||
return cancel
|
||||
@ -149,7 +150,7 @@ func ChangedPrewarmingPoolSize(id dto.EnvironmentID, count uint) {
|
||||
WriteInfluxPoint(p)
|
||||
}
|
||||
|
||||
// WriteInfluxPoint schedules the indlux data point to be sent.
|
||||
// WriteInfluxPoint schedules the influx data point to be sent.
|
||||
func WriteInfluxPoint(p *write.Point) {
|
||||
if influxClient != nil {
|
||||
p.AddTag("stage", config.Config.InfluxDB.Stage)
|
||||
|
Reference in New Issue
Block a user