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

[Scanner] handle current execution to read from blobstore #3435

Merged
merged 10 commits into from
Aug 5, 2020
Prev Previous commit
Next Next commit
Fix get dlq size NPE (#3422)
  • Loading branch information
yux0 authored and mkolodezny committed Aug 4, 2020
commit 200194796d6575939f771498d3cc1930f06795a8
20 changes: 9 additions & 11 deletions service/history/replication/task_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,22 +536,20 @@ func (p *taskProcessorImpl) emitDLQSizeMetricsLoop() {
select {
case <-timer.C:
resp, err := p.shard.GetExecutionManager().GetReplicationDLQSize(staticRequest)
if err != nil {
p.logger.Error("failed to get one task from replication DLQ", tag.Error(err))
p.metricsClient.Scope(metrics.ReplicationDLQStatsScope).IncCounter(metrics.ReplicationDLQProbeFailed)
}

p.metricsClient.Scope(
metrics.ReplicationDLQStatsScope,
metrics.InstanceTag(strconv.Itoa(p.shard.GetShardID())),
).UpdateGauge(metrics.ReplicationDLQSize, float64(resp.Size))

timer.Reset(backoff.JitDuration(
dlqMetricsEmitTimerInterval,
dlqMetricsEmitTimerCoefficient,
))
if err != nil {
p.logger.Error("failed to get replication DLQ size", tag.Error(err))
p.metricsClient.Scope(metrics.ReplicationDLQStatsScope).IncCounter(metrics.ReplicationDLQProbeFailed)
} else {
p.metricsClient.Scope(
metrics.ReplicationDLQStatsScope,
metrics.InstanceTag(strconv.Itoa(p.shard.GetShardID())),
).UpdateGauge(metrics.ReplicationDLQSize, float64(resp.Size))
}
case <-p.done:
timer.Stop()
return
}
}
Expand Down