Skip to content

Address concurrency issue at resource_ended_at_normalization#1501

Merged
tobias-urdin merged 1 commit into
gnocchixyz:masterfrom
rafaelweingartner:address-concurrency-issue-resource-ended-at-normalization
May 8, 2026
Merged

Address concurrency issue at resource_ended_at_normalization#1501
tobias-urdin merged 1 commit into
gnocchixyz:masterfrom
rafaelweingartner:address-concurrency-issue-resource-ended-at-normalization

Conversation

@rafaelweingartner

Copy link
Copy Markdown
Contributor

We discovered that the method "resource_ended_at_normalization" can be affected by a concurrency issue when multiple Gnocchi MetricD agents reach the same code at similar moments in time. As a consequence, we see multiple revisions being created in the resource, where the only change is the "ended_at" field.

The multiple entries in the resource history are not a problem per se. However, it can create more load on the metadata DB that Gnocchi uses.

This patch is addressing this situation by creating a lock mechanism, so multiple MetricD do not enter in the normalization part of the code together

We discovered that the method "resource_ended_at_normalization"
can be affected by a concurrency issue when multiple Gnocchi
MetricD agents reach the same code at similar moments in time.
As a consequence, we see multiple revisions being created in the
resource, where the only change is the "ended_at" field.

The multiple entries in the resource history are not a problem
per se. However, it can create more load on the metadata DB
that Gnocchi uses.

This patch is addressing this situation by creating a lock
mechanism, so multiple MetricD do not enter in the normalization
part of the code together
@tobias-urdin tobias-urdin merged commit c8aaf11 into gnocchixyz:master May 8, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants