Skip to content

Commit

Permalink
exporter: fix hang when exporter fails to start
Browse files Browse the repository at this point in the history
[upstream commit: 44bd44c]

The Exporter.Start() implementation uses a WaitGroup to wait until the exporter is ready after launching it in a goroutine. Unfortunately, this WaitGroup never gets set to Done when we encounter an error while starting the exporter. This ultimately causes the Tetragon process to hang indefinitely. Fix the issue by simply calling readyWG.Done() when we encounter an error here.

Signed-off-by: William Findlay <[email protected]>
  • Loading branch information
willfindlay authored and mtardy committed Apr 8, 2024
1 parent 7324408 commit 964bd00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,23 @@ func (s *Server) GetEventsWG(request *tetragon.GetEventsRequest, server tetragon
}).Debug("Received a GetEvents request")
allowList, err := filters.BuildFilterList(s.ctx, request.AllowList, filters.Filters)
if err != nil {
if readyWG != nil {
readyWG.Done()
}
return err
}
denyList, err := filters.BuildFilterList(s.ctx, request.DenyList, filters.Filters)
if err != nil {
if readyWG != nil {
readyWG.Done()
}
return err
}
aggregator, err := aggregator.NewAggregator(server, request.AggregationOptions)
if err != nil {
if readyWG != nil {
readyWG.Done()
}
return err
}
if aggregator != nil {
Expand Down

0 comments on commit 964bd00

Please sign in to comment.