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

Disable URLConnection cache in CLI #180

Merged
merged 1 commit into from
Oct 7, 2019
Merged

Conversation

mtdowling
Copy link
Member

When running Smithy in a build tool like Gradle, Smithy is run multiple
times within a thread. Java's URLConnection has a cache built-in for
loading JARs, and when a JAR is updated during a Smithy build, it can
cause checksum exceptions when attempting to load that same JAR from a
subsequent run through the cache. This commit disables the cache when
running Smithy through the CLI to prevent this issue (Gradle runs Smithy
via the CLI in a thread).

(I couldn't find a way to test this other than manually test that it fixed the issues I was running into when using it with the Gradle plugin)

When running Smithy in a build tool like Gradle, Smithy is run multiple
times within a thread. Java's URLConnection has a cache built-in for
loading JARs, and when a JAR is updated during a Smithy build, it can
cause checksum exceptions when attempting to load that same JAR from a
subsequent run through the cache. This commit disables the cache when
running Smithy through the CLI to prevent this issue (Gradle runs Smithy
via the CLI in a thread).
@@ -142,7 +157,6 @@ public ModelAssembler reset() {
validators.clear();
suppressions.clear();
documentNodes.clear();
properties.clear();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties should have never of been cleared during a call to reset(). Reset should clear out transient state of the assembler, not configuration like properties.

@mtdowling mtdowling merged commit 961d8a5 into master Oct 7, 2019
@mtdowling mtdowling deleted the no-jar-caches-in-cli branch October 15, 2019 20:10
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

Successfully merging this pull request may close these issues.

2 participants