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

Fix restartAttemptPeriod comparison in restart tracker #4229

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Conversation

timj-hh
Copy link
Contributor

@timj-hh timj-hh commented Jul 2, 2024

Summary

This change fixes a bug with the restart tracker whereby nanosecond time.Durations were being compared to the restartAttemptPeriod in seconds.

Implementation details

Very quick container exits seem to allow for a situation where the restartAttemptPeriod appears elapsed, even if it is not. Instead of comparing two time.Duration objects we can compare the float64 seconds representation of the elapsed exit time to our reset attempt period.

Testing

make test

New tests cover the changes:

Description for the changelog

Fix restartAttemptPeriod comparison in ecs-agent restart tracker

Does this PR include breaking model changes? If so, Have you added transformation functions?
no

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@timj-hh timj-hh requested a review from a team as a code owner July 2, 2024 23:30
@JoseVillalta
Copy link
Contributor

LGTM

@timj-hh timj-hh merged commit ae753fb into aws:dev Jul 8, 2024
40 checks passed
jiuchoe4 pushed a commit to saurabhc123/amazon-ecs-agent that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants