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

Config saving improvements - #153

Open
2 of 6 tasks
cben opened this issue Oct 6, 2020 · 1 comment
Open
2 of 6 tasks

Config saving improvements - #153

cben opened this issue Oct 6, 2020 · 1 comment

Comments

@cben
Copy link
Contributor

cben commented Oct 6, 2020

[based on looking at code, conclusions untested]

Consider scenario of shell scripts running many ocm processes in a loop / in parallel.

  • config.Save should be atomic (write temp file -> os.Rename) to avoid partially corrupted partial file from being read by concurrent processes.

We should make sure this scenario can't hammer SSO with too many requests.

  • If token saved by ocm login is fresh, we do zero requests to SSO.
  • Currently most commands update the file with fresh tokens. They do this at the end, if successful.
  • Thus, if OCM API is consistently erroring for some reason (whether outage or bad use), request rate from ocm to SSO could spike to an attempt every execution. Can we move saving tokes to immediately after obtaining them?
  • ocm list ... commands don't save tokens.
  • If SSO itself is erroring, ideally we should obey some SSO rate limit / backoff across ocm executions. This would require saving backoff timestamp to file? Complex to do right, not sure worth doing.
@2uasimojo
Copy link

It's possible that, along with what's described above, the intent of #69 would be satisfied by adding:

  • Don't delete offline token from the config

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

No branches or pull requests

2 participants