Skip to content
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

[8.x] internal/beater/config: fix 32-bit arch overflow (backport #15216) #15248

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 14, 2025

Motivation/summary

Rather than converting from float64 to int and back, which may overflow on 32-bit architectures, check if the duration has a sub-second component through an integer modulo operation.

Checklist

How to test these changes

Run apm-server with the largest possible whole second duration for apm-server.agent.config.cache.expiration: 2562047h47m16s. Prior to this PR, that should fail on 32-bit architectures.

Related issues

None


This is an automatic backport of pull request #15216 done by Mergify.

* internal/beater/config: fix 32-bit arch overflow

Rather than converting from float64 to int and back,
which may overflow on 32-bit architectures, check if
the duration has a sub-second component through an
integer modulo operation.

* Add changelog

(cherry picked from commit 53bbcaf)
@mergify mergify bot requested a review from a team as a code owner January 14, 2025 21:45
@mergify mergify bot added the backport label Jan 14, 2025
@mergify mergify bot assigned axw Jan 14, 2025
@mergify mergify bot merged commit 8861926 into 8.x Jan 14, 2025
18 checks passed
@mergify mergify bot deleted the mergify/bp/8.x/pr-15216 branch January 14, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants