Skip to content

fix(disk-buffer): Expire metric tracking information in the right place #17284

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

Merged
merged 2 commits into from
Jul 3, 2025

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Jul 2, 2025

Summary

The current code tries to cleanup the tracking information cache during deserialization. That is, if the refcount of the metric is one on deserialization the tracking information is removed from the cache. However, if that metric cannot be sent it is pushed back into (or rather left in) the buffer but now the required tracking information is gone. In turn the metric is skipped due to missing tracking information and the input is potentially never notified.

This PR moves the cache cleanup into the refcount decrementation function and only removes the entry if notifications are sent, i.e. if the refcount reaches zero.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16981

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jul 2, 2025
@srebhan srebhan changed the title fix(metric): Expire metric tracking information in the right place fix(disk-buffer): Expire metric tracking information in the right place Jul 2, 2025
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jul 2, 2025

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

☺️ This pull request doesn't significantly change the Telegraf binary size (less than 1%)

📦 Click here to get additional PR build artifacts

Artifact URLs

. DEB . RPM . TAR . GZ . ZIP
[[amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip] [arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip] [armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip] [armhf.deb i386.rpm freebsd_armv7.tar.gz ] [i386.deb ppc64le.rpm freebsd_i386.tar.gz ] [mips.deb riscv64.rpm linux_amd64.tar.gz ] [mipsel.deb s390x.rpm linux_arm64.tar.gz ] [ppc64el.deb x86_64.rpm linux_armel.tar.gz ] [riscv64.deb linux_armhf.tar.gz ] [s390x.deb linux_i386.tar.gz ] [ linux_mips.tar.gz ] [ linux_mipsel.tar.gz ] [ linux_ppc64le.tar.gz ] [ linux_riscv64.tar.gz ] [ linux_s390x.tar.gz ]]

@mstrandboge mstrandboge removed their assignment Jul 2, 2025
@mstrandboge mstrandboge added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jul 2, 2025
Copy link
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srebhan Nicely Done!

@skartikey skartikey merged commit 533bd46 into influxdata:master Jul 3, 2025
28 of 29 checks passed
@github-actions github-actions bot added this to the v1.35.2 milestone Jul 3, 2025
srebhan added a commit that referenced this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

measurements from disk buffer not (fully) retransmitted after output outtake
3 participants