Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

CacheResourceLoader leaking FileInputStream #693

Open
wmccusker opened this issue Apr 24, 2020 · 0 comments
Open

CacheResourceLoader leaking FileInputStream #693

wmccusker opened this issue Apr 24, 2020 · 0 comments

Comments

@wmccusker
Copy link

When using the raml parser to validate a definition I was running into an issue that the raml file and any files it referenced could not be deleted on Windows. I was able to find the stack trace below that created the FileInputStream that was never closed. From reviewing the code it looks like CacheResourceLoader reads from the input stream but never closes the stream causing the leak.

I will submit a pull request soon.

Stack Track

at java.io.FileInputStream.(FileInputStream.java:139)
at java.io.FileInputStream.(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.raml.v2.api.loader.RootRamlUrlResourceLoader.fetchResource(RootRamlUrlResourceLoader.java:48)
at org.raml.v2.api.loader.CompositeResourceLoader.fetchResource(CompositeResourceLoader.java:41)
at org.raml.v2.api.loader.CacheResourceLoader.fetchResource(CacheResourceLoader.java:69)
at org.raml.v2.internal.impl.commons.phase.IncludeResolver.transform(IncludeResolver.java:70)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:45)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.yagi.framework.phase.TransformationPhase.apply(TransformationPhase.java:54)
at org.raml.v2.internal.impl.v10.Raml10Builder.runPhases(Raml10Builder.java:145)
at org.raml.v2.internal.impl.v10.Raml10Builder.build(Raml10Builder.java:123)
at org.raml.v2.internal.impl.v10.Raml10Builder.build(Raml10Builder.java:89)
at org.raml.v2.internal.impl.RamlBuilder.build(RamlBuilder.java:126)
at org.raml.v2.internal.impl.RamlBuilder.build(RamlBuilder.java:108)
at org.raml.v2.api.RamlModelBuilder.buildApi(RamlModelBuilder.java:125)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant