Skip to content

Commit

Permalink
filterx-metrics: do not call racy expression unref() from non-main th…
Browse files Browse the repository at this point in the history
…reads

Signed-off-by: László Várady <[email protected]>
  • Loading branch information
MrAnno committed Aug 23, 2024
1 parent eeefc6c commit aa2cf22
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/filterx/filterx-metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _format_sck(FilterXMetrics *self, StatsClusterKey *sck)
static gboolean
_is_const(FilterXMetrics *self)
{
return !self->key.expr && (!self->labels || filterx_metrics_labels_is_const(self->labels));
return !self->key.expr && (self->const_cluster || filterx_metrics_labels_is_const(self->labels));
}

static void
Expand Down Expand Up @@ -134,9 +134,6 @@ _optimize(FilterXMetrics *self)
g_free(self->key.str);
self->key.str = NULL;

filterx_metrics_labels_free(self->labels);
self->labels = NULL;

exit:
g_atomic_counter_set(&self->is_optimized, TRUE);
stats_unlock();
Expand Down

0 comments on commit aa2cf22

Please sign in to comment.