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

Dynamic namespace loading can cause race conditions #92

Closed
levand opened this issue Aug 20, 2019 · 3 comments
Closed

Dynamic namespace loading can cause race conditions #92

levand opened this issue Aug 20, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@levand
Copy link

levand commented Aug 20, 2019

Affected Component & Version: com.cognitect.aws/api 0.8.352

Problem Description

It is possible to invoke cognitect.aws.api/client concurrently, such that the dynamically generated call to require on line 78 (https://github.com/cognitect-labs/aws-api/blob/v0.8.352/src/cognitect/aws/client/api.clj#L78) is also invoked concurrently.

This permits a race condition where, if namespace loading goes just wrong, can result in spurious No such var compile exceptions on otherwise straightforward code in the dynamically loaded namespaces.

Proposed Solution

Ensure that the dynamic call to require cannot be called in parallel, e.g by wrapping it in a locking form.

Pre-patch workaround

Ensure that calling code does not invoke cognitect.aws.api/client in parallel.

@levand levand added the bug Something isn't working label Aug 20, 2019
@dchelimsky
Copy link
Contributor

Fixed in 5f6fdbd. Will close after released.

@dchelimsky
Copy link
Contributor

Thanks, as always, @levand, for the descriptive and actionable report.

@dchelimsky
Copy link
Contributor

Released in 0.8.378.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants