Skip to content

Commit

Permalink
Update logging tag with the correct component (#3016)
Browse files Browse the repository at this point in the history
* Update logging tag with the correct component
  • Loading branch information
yux0 authored and andrewjdawson2016 committed Jan 30, 2020
1 parent ba50eb1 commit 939b320
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions service/history/taskProcessor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Uber Technologies, Inc.
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -100,8 +100,6 @@ func newTaskProcessor(
logger log.Logger,
) *taskProcessor {

log := logger.WithTags(tag.ComponentTimerQueue)

workerNotificationChans := []chan struct{}{}
for index := 0; index < options.workerCount; index++ {
workerNotificationChans = append(workerNotificationChans, make(chan struct{}, 1))
Expand All @@ -113,7 +111,7 @@ func newTaskProcessor(
shutdownCh: make(chan struct{}),
tasksCh: make(chan *taskInfo, options.queueSize),
config: shard.GetConfig(),
logger: log,
logger: logger,
metricsClient: shard.GetMetricsClient(),
timeSource: shard.GetTimeSource(),
workerNotificationChans: workerNotificationChans,
Expand All @@ -130,15 +128,15 @@ func (t *taskProcessor) start() {
notificationChan := t.workerNotificationChans[i]
go t.taskWorker(notificationChan)
}
t.logger.Info("Timer queue task processor started.")
t.logger.Info("Task processor started.")
}

func (t *taskProcessor) stop() {
close(t.shutdownCh)
if success := common.AwaitWaitGroup(&t.workerWG, time.Minute); !success {
t.logger.Warn("Timer queue task processor timedout on shutdown.")
t.logger.Warn("Task processor timed out on shutdown.")
}
t.logger.Info("Timer queue task processor shutdown.")
t.logger.Info("Task processor shutdown.")
}

func (t *taskProcessor) taskWorker(
Expand Down
2 changes: 1 addition & 1 deletion service/history/timerQueueProcessorBase.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func newTimerQueueProcessorBase(
workerCount: shard.GetConfig().TimerTaskWorkerCount(),
queueSize: shard.GetConfig().TimerTaskWorkerCount() * shard.GetConfig().TimerTaskBatchSize(),
}
taskProcessor := newTaskProcessor(options, shard, historyService.historyCache, logger)
taskProcessor := newTaskProcessor(options, shard, historyService.historyCache, log)
base := &timerQueueProcessorBase{
scope: scope,
shard: shard,
Expand Down

0 comments on commit 939b320

Please sign in to comment.