Join GitHub today
EnrichedResponse.file leaks open files #440
EnrichedResponse.file opens a file, but nothing seems to close it again
When returning a file in a Finatra Controller, I expect the returned file to be closed when the request/response is finished.
I am using code as follows
Which is using
The current code leaves the file open in jvm increasing the number of open files on the OS.
Steps to reproduce the behavior
Add a controller to a finatra server as described above, invoke the controller (e.g. in a browser /myfile.json), try to delete the file (on Windows this gives an error message like "cannot delete an open file") or on a more fun OS count the number of open files before and after.