Skip to content

Commit

Permalink
Add timeout to endpointset metric collector
Browse files Browse the repository at this point in the history
We have seen deadlocks with endpoint discovery caused by the metric
collector hanging and not releasing the store labels lock. This causes
the endpoint update to hang, which also makes all endpoint readers hang on
acquiring a read lock for the resolved endpoints slice.

This commit makes sure the Collect method on the metrics collector has
a built in timeout to guard against cases where an upstream call never
reads from the collection channel.

Signed-off-by: Filip Petkovski <[email protected]>
  • Loading branch information
fpetkovski authored and jnyi committed Oct 16, 2024
1 parent 9d27e07 commit 458cddd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/query/endpointset.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ type endpointSetNodeCollector struct {
storeNodesAddr map[string]map[string]int
storeNodesKeys map[string]map[string]int

logger log.Logger
connectionsDesc *prometheus.Desc
labels []string
connectionsWithAddr *prometheus.Desc
connectionsWithKeys *prometheus.Desc
logger log.Logger
}

func newEndpointSetNodeCollector(logger log.Logger, labels ...string) *endpointSetNodeCollector {
Expand Down

0 comments on commit 458cddd

Please sign in to comment.