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

parse stale querystring parameter value as boolean #15562

Closed
tgross opened this issue Dec 16, 2022 · 2 comments · Fixed by #15605
Closed

parse stale querystring parameter value as boolean #15562

tgross opened this issue Dec 16, 2022 · 2 comments · Fixed by #15605

Comments

@tgross
Copy link
Member

tgross commented Dec 16, 2022

The stale parameter on the Nomad HTTP API determines the consistency mode for query endpoints. If the stale flag is set, a request to a follower will be served without being forwarded to the leader. Unfortunately the API server tolerates this flag have a value, but it only acts on the flag being set.

This means a request like /v1/jobs?stale=false is treated as a stale query. While the documentation is straightforward on this, it's bad ergonomics and can lead to mistakes. Instead, we should parse any value as a boolean (and keep the existing behavior where if the flag is set without a value, the query is stale). So in other words we want:

querystring is stale query?
?stale yes
?stale=true yes
?stale=false no
@dttung2905
Copy link
Contributor

If you don't mind, please allow me to work on this issue.

@github-actions
Copy link

github-actions bot commented May 2, 2023

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants