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

Rename service.Application.stopTestChan to service.Application.stopChan #50

Closed
wants to merge 4 commits into from
Closed
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
12 changes: 6 additions & 6 deletions service/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ type Application struct {

parserProvider parserprovider.ParserProvider

// stopTestChan is used to terminate the application in end to end tests.
stopTestChan chan struct{}
// stopChan is used to terminate the application in end to end tests.
stopChan chan struct{}

// signalsChannel is used to receive termination signals from the OS.
signalsChannel chan os.Signal
Expand Down Expand Up @@ -175,10 +175,10 @@ func (app *Application) Shutdown() {
// See https://github.com/open-telemetry/opentelemetry-collector/issues/483.
defer func() {
if r := recover(); r != nil {
app.logger.Info("stopTestChan already closed")
app.logger.Info("stopChan already closed")
}
}()
close(app.stopTestChan)
close(app.stopChan)
}

func (app *Application) setupTelemetry(ballastSizeBytes uint64) error {
Expand All @@ -201,14 +201,14 @@ func (app *Application) runAndWaitForShutdownEvent() {
signal.Notify(app.signalsChannel, os.Interrupt, syscall.SIGTERM)

// set the channel to stop testing.
app.stopTestChan = make(chan struct{})
app.stopChan = make(chan struct{})
app.stateChannel <- Running
select {
case err := <-app.asyncErrorChannel:
app.logger.Error("Asynchronous error received, terminating process", zap.Error(err))
case s := <-app.signalsChannel:
app.logger.Info("Received signal from OS", zap.String("signal", s.String()))
case <-app.stopTestChan:
case <-app.stopChan:
app.logger.Info("Received stop test request")
}
app.stateChannel <- Closing
Expand Down