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

always return file policy for same id #625

Closed
wants to merge 1 commit into from

Conversation

Seros
Copy link
Contributor

@Seros Seros commented Apr 21, 2023

Addresses #519

I tried to reproduce the issue locally by setting up the autoscale and a local nomad agent running and connection each other. When restarting nomad the error message "failed to call the Nomad list policies" was shown as described in the issue and during debugging I noticed that the handler has no current policy anymore. I digged deeper and found the reason. The file source does not return a policy because the one that gets monitored is already registered in the policyMap and so no policy update is triggered which would set the currentPolicy at https://github.com/hashicorp/nomad-autoscaler/blob/main/policy/handler.go#L153
With this change the policy will be returned no matter what happened to the handler/source.

@gulducat
Copy link
Member

As mentioned in #733, this totally does fix the issue, but selfishly I went with my own PR instead, so I'll close this one out.

Thanks again for the submission @Seros! ❤️

@gulducat gulducat closed this Oct 11, 2023
@Seros Seros deleted the fix-519-after-nomad-api-fail branch October 11, 2023 17:10
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.

2 participants