Completed
Details
Assignee
UnassignedUnassignedReporter
Former userFormer user(Deactivated)Approval
OkPatch
CodePriority
MajorAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Former user
Former user(Deactivated)Approval
Ok
Patch
Code
Priority

Affects versions
Fix versions
Created February 16, 2015 at 9:08 AM
Updated August 10, 2015 at 7:35 PM
Resolved August 10, 2015 at 7:35 PM
clojure's compile function leaks file descriptors, i.e. it relies on garbage collection to close the files. I'm trying to use boot [1] on windows and ran into the problem, that files could not be deleted intermittently [2]. The problem is that clojure's compile function, or rather clojure.lang.RT.lastModified() relies on garbage collection to close files. lastModified() looks like:
Here's the stacktrace from file leak detector [3]:
Cause: getLastModified() opens the URLConnection's InputStream but does not close it.
Approach: On Stackoverflow [4] there's a discussion on how to close the URLConnection correctly.
On non-Windows operating systems this shouldn't be much of a problem. But on windows this hurts very much, since you can't delete files that are opened by some process.
Patch: clj-1659-v3.patch
Screened by: Alex Miller
[1] http://boot-clj.com/
[2] https://github.com/boot-clj/boot/issues/117
[3] http://file-leak-detector.kohsuke.org/
[4] http://stackoverflow.com/questions/9150200/closing-urlconnection-and-inputstream-correctly