File tree Expand file tree Collapse file tree
heartbeat/monitors/active/icmp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,6 +400,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
400400
401401- Fixed excessive memory usage introduced in 7.5 due to over-allocating memory for HTTP checks. {pull}15639[15639]
402402- Fixed TCP TLS checks to properly validate hostnames, this broke in 7.x and only worked for IP SANs. {pull}17549[17549]
403+ - Fix panic when initialization of ICMP monitors fail twice. {pull}25073[25073]
403404
404405*Journalbeat*
405406
Original file line number Diff line number Diff line change @@ -87,20 +87,25 @@ type requestResult struct {
8787// These vars should not be used directly, but rather getStdLoop
8888// should be invoked to initialize and return stdLoop.
8989var (
90- stdICMPLoopInit sync.Once
90+ stdICMPLoopInit sync.Mutex
9191 stdICMPLoopSingleton * stdICMPLoop
9292)
9393
9494func getStdLoop () (* stdICMPLoop , error ) {
95- var loopErr error
96- stdICMPLoopInit .Do (func () {
95+ stdICMPLoopInit .Lock ()
96+ defer stdICMPLoopInit .Unlock ()
97+
98+ if stdICMPLoopSingleton == nil {
9799 debugf ("initializing ICMP loop" )
98- stdICMPLoopSingleton , loopErr = newICMPLoop ()
99- if loopErr = = nil {
100- debugf ( "ICMP loop successfully initialized" )
100+ singleton , err : = newICMPLoop ()
101+ if err ! = nil {
102+ return nil , err
101103 }
102- })
103- return stdICMPLoopSingleton , loopErr
104+ stdICMPLoopSingleton = singleton
105+ debugf ("ICMP loop successfully initialized" )
106+ }
107+
108+ return stdICMPLoopSingleton , nil
104109}
105110
106111func noPingCapabilityError (message string ) error {
You can’t perform that action at this time.
0 commit comments