Skip to content

Address test races caused by deferred logs #6841

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

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions service/history/queue/timer_queue_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ func (t *timerQueueProcessor) drain() {
}

func (t *timerQueueProcessor) completeTimerLoop() {
defer t.shutdownWG.Done()

t.logger.Info("Timer queue processor completeTimerLoop")
defer t.logger.Info("Timer queue processor completeTimerLoop completed")

defer t.shutdownWG.Done()

completeTimer := time.NewTimer(t.config.TimerProcessorCompleteTimerInterval())
defer completeTimer.Stop()

Expand Down
2 changes: 1 addition & 1 deletion service/history/queue/timer_queue_processor_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ func (t *timerQueueProcessorBase) Stop() {
}

t.logger.Info("Timer queue processor state changed", tag.LifeCycleStopping)
defer t.logger.Info("Timer queue processor state changed", tag.LifeCycleStopped)

t.timerGate.Stop()
close(t.shutdownCh)
Expand All @@ -200,6 +199,7 @@ func (t *timerQueueProcessorBase) Stop() {
}

t.redispatcher.Stop()
t.logger.Info("Timer queue processor state changed", tag.LifeCycleStopped)
}

func (t *timerQueueProcessorBase) processorPump() {
Expand Down
4 changes: 2 additions & 2 deletions service/history/queue/transfer_queue_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,11 @@ func (t *transferQueueProcessor) drain() {
}

func (t *transferQueueProcessor) completeTransferLoop() {
defer t.shutdownWG.Done()

t.logger.Info("Transfer queue processor completeTransferLoop")
defer t.logger.Info("Transfer queue processor completeTransferLoop completed")

defer t.shutdownWG.Done()

completeTimer := time.NewTimer(t.config.TransferProcessorCompleteTransferInterval())
defer completeTimer.Stop()

Expand Down
2 changes: 1 addition & 1 deletion service/history/queue/transfer_queue_processor_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ func (t *transferQueueProcessorBase) Stop() {
}

t.logger.Info("Transfer queue processor state changed", tag.LifeCycleStopping)
defer t.logger.Info("Transfer queue processor state changed", tag.LifeCycleStopped)

close(t.shutdownCh)
if t.startJitterTimer != nil {
Expand All @@ -204,6 +203,7 @@ func (t *transferQueueProcessorBase) Stop() {
}

t.redispatcher.Stop()
t.logger.Info("Transfer queue processor state changed", tag.LifeCycleStopped)
}

func (t *transferQueueProcessorBase) notifyNewTask(info *hcommon.NotifyTaskInfo) {
Expand Down