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

parallel invocation of cf oauth-token sporadically leads to io errors #2989

Closed
4 tasks done
rlindner81 opened this issue Jul 4, 2024 · 2 comments
Closed
4 tasks done

Comments

@rlindner81
Copy link

Please fill out the issue checklist below and provide ALL the requested information.

  • I reviewed open and closed github issues that may be related to my problem.
  • I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with
Provide details on what you were trying to do (and why).

I use cf-cli implicitly in other scripts that do more heavy duty work and these often run in parallel. For even low levels of concurrency, like 5--10 you sporadically see errors of the type:

error: caught error during cf oauth-token
non-zero return code 1
FAILED
Error read/writing config:  remove HOME/.cf/temp-config2869106190: no such file or directory

error: caught error during cf oauth-token
non-zero return code 1
FAILED
Error read/writing config:  remove HOME/.cf/temp-config2869106190: no such file or directory

The error occurs more reliably with more concurrency. For 16 or 20 parallel executions it happens every time on my machine. I suspect the temp filename generator is tied to something that doesn't handle parallel execution well, like a low-resolution timestamp.

What happened
A clear and concise description of what happened.

See above.

Expected behavior
A clear and concise description of what you expected to happen.

IMO there is no reason cf oauth-token should not work for, say 20 processes running in parallel.

Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:

I wrote a simple bash script to produce:

#!/bin/sh

concurrency=16
process_ids=()

for ((i = 0; i < concurrency; i++)); do
  cf oauth-token >/dev/null &
  process_ids+=($!)
done

wait "${process_ids[@]}"

Provide more context

  • platform and shell details ( e.g. Mac OS X 10.11 iTerm)
% uname -a
Darwin xxx 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
  • version of the CLI you are running
% cf -v
cf version 8.7.10+5b7ce3c.2024-04-04
  • version of the CC API Release you are on
    unrelated

Notes regarding V6 and V7 CLI support:

  • V6:
    • Minimum supported version of CF Deployment: v7.0.0 (CAPI Release: 1.74.0 (APIs 2.128.0 and 3.63.0))
    • Maximum supported version of CF Deployment: v13.4.0 (CAPI Release: 1.94.0 (APIs 2.149.0 and 3.84.0))
  • V7:
    • Minimum supported version of CF Deployment: v13.5.0 (CAPI Release: 1.95.0 (APIs 2.150.0 and 3.85.0))
@Samze
Copy link
Contributor

Samze commented Jul 8, 2024

Hey @rlindner81

This should be fixed in the next version. See #2931.

@rlindner81
Copy link
Author

Hey @rlindner81

This should be fixed in the next version. See #2931.

Yes that issue and fix look good. Sorry for double posting, I had not seen this one...

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