Skip to content

Commit

Permalink
Do not use ReportFatalError in Start(), it will deadlock (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacd authored Jul 20, 2023
1 parent c3cb586 commit 4b4c600
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions generatorreceiver/generator_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ func (g generatorReceiver) loadTopoFile(topoInline string, path string) (topoFil
func (g generatorReceiver) Start(ctx context.Context, host component.Host) error {
topoFile, err := g.loadTopoFile(g.topoInline, g.topoPath)
if err != nil {
host.ReportFatalError(err)
return fmt.Errorf("could not load topo file: %w", err)
}

err = validateConfiguration(*topoFile)
if err != nil {
host.ReportFatalError(err)
return fmt.Errorf("could not validate topo file: %w", err)
}

g.logger.Info("starting flag manager", zap.Int("flag_count", flags.Manager.FlagCount()))
Expand Down Expand Up @@ -160,7 +160,6 @@ func (g *generatorReceiver) startMetricGenerator(ctx context.Context, host compo
host.ReportFatalError(err)
}
}

}
}()

Expand Down

0 comments on commit 4b4c600

Please sign in to comment.