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

otel-cli --tp-carrier should flock() the file around writes #80

Open
tobert opened this issue Sep 14, 2021 · 0 comments
Open

otel-cli --tp-carrier should flock() the file around writes #80

tobert opened this issue Sep 14, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed minor minor semver

Comments

@tobert
Copy link
Member

tobert commented Sep 14, 2021

A frequent scripting trick is to forkbomb a bunch of things in parallel e.g. with xargs -P or plain old shell job control. When this happens, the child might want to do e.g. otel-cli exec --tp-carrier "$otel_carrier" curl -H "traceparent: $TRACEPARENT" https://my/api/v1/thing in the subprocesses. When this happens there is technically a race condition accessing the carrier file for read and write.

This probably isn't a big deal in practice because the file is so tiny, but we should do the right thing anyways.

https://github.com/gofrs/flock looks like a portable solution that probably won't blow up the dependency tree.

@tobert tobert added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed minor minor semver labels Sep 14, 2021
@edw-eqix edw-eqix self-assigned this Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed minor minor semver
Projects
None yet
Development

No branches or pull requests

2 participants