Skip to content

Commit 37af3c5

Browse files
committed
lint
Signed-off-by: Jess Yuen <[email protected]>
1 parent d89ee47 commit 37af3c5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

internal/app/orchestrator/orchestrator.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,17 @@ func (o *orchestrator) CreateWatch(req gcp.Request) (chan gcp.Response, func())
177177
// If we have a cached response and the version is different,
178178
// immediately push the result to the response channel.
179179
go func() {
180-
responseChannel.addResponse(convertToGcpResponse(cached.Resp, req))
181-
metrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorWatchFanouts).Inc(1)
180+
err := responseChannel.addResponse(convertToGcpResponse(cached.Resp, req))
181+
if err != nil {
182+
// Sanity check that the channel isn't blocked. This shouldn't
183+
// ever happen since the channel is newly created. Regardless,
184+
// continue to create the watch.
185+
o.logger.With("aggregated_key", aggregatedKey, "error", err).Warn(context.Background(),
186+
"failed to push cached response")
187+
metrics.OrchestratorWatchErrorsSubscope(o.scope, aggregatedKey).Counter(metrics.ErrorChannelFull).Inc(1)
188+
} else {
189+
metrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorWatchFanouts).Inc(1)
190+
}
182191
}()
183192
}
184193

0 commit comments

Comments
 (0)