Bug 1122779 - [GSS] (6.3.1) DataSourceProvider does not delete the temporary files it creates
Summary: [GSS] (6.3.1) DataSourceProvider does not delete the temporary files it creates
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: RESTEasy
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: CR1
: EAP 6.3.1
Assignee: Weinan Li
QA Contact: Katerina Odabasi
URL:
Whiteboard:
Depends On: 1113338
Blocks: eap631-blockers, eap631-payload, eap63-cp01-blockers 1105695
TreeView+ depends on / blocked
 
Reported: 2014-07-24 04:31 UTC by Kyle Lape
Modified: 2018-12-06 17:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
The `DataSourceProvider` (org.jboss.resteasy.plugins.providers.DataSourceProvider.readDataSource(InputStream, MediaType)) creates a temporary file named `resteasy-provider-datasource ... .tmp` when reading more then 4096 bytes. However, it does not delete the created temporary file itself nor does it provide a facility to do so, resulting in a resource leak. This issue is under investigation and is expected to be resolved in the next release.
Clone Of: 1113338
Environment:
Last Closed: 2014-10-13 18:37:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RESTEASY-1080 0 Major Closed DataSourceProvider does not delete the temporary files it creates 2016-08-02 16:15:27 UTC

Description Kyle Lape 2014-07-24 04:31:26 UTC
The DataSourceProvider (org.jboss.resteasy.plugins.providers.DataSourceProvider.readDataSource(InputStream, MediaType)) creates a temporary file named "resteasy-provider-datasource ... .tmp" when reading more then 4096 bytes. However, it does not delete the created temporary file itself nor does it provide a facility to do so. This results in a resource leak.

Comment 3 Kyle Lape 2014-07-24 21:16:44 UTC
The file is now marked for deletion at the shut down of the JVM.  In addition, the file is deleted immediately once the input stream has reached the end.  

While this commit improvies the behavior of RESTEasy, it does not completely eliminate the potential of a build-up of temporary files.  If a endpoint does not fully consume attachments, then they won't be deleted until the JVM is restarted, which could be a long time.

A potential workaround is to create an EJB timer to delete these files periodically.  I wrote such an EJB here:

https://github.com/kylape/resteasy-datasource-cleaner

Currently waiting for the upstream PRs to be merged.

Comment 5 Weinan Li 2014-08-06 11:49:55 UTC
Upstream trunk merged: https://github.com/resteasy/Resteasy/pull/532

@Kyle, could you please create a PR for Branch_2_3 upstream also?

I'll merge this to 2.3.8.SP2-redhat for EAP 6.3.1.

Comment 6 Weinan Li 2014-08-12 04:55:13 UTC
Upgrading RESTEasy to 2.3.8.SP2 solves the problem: https://github.com/jbossas/jboss-eap/pull/1557/files

Comment 7 Kyle Lape 2014-08-12 05:38:29 UTC
Hi Weinan,  I didn't see this commit in the 2.3.8.SP2 branch.  Can you please double check it made the build?  My apologies if I was supposed to push the commit myself.  Thanks.

Comment 8 Weinan Li 2014-08-14 08:02:04 UTC
(In reply to Kyle Lape from comment #7)
> Hi Weinan,  I didn't see this commit in the 2.3.8.SP2 branch.  Can you
> please double check it made the build?  My apologies if I was supposed to
> push the commit myself.  Thanks.

Seems like I forgot to push my changes. I'll ask Dustin to rebuild a -redhat-2 to include it.

Comment 9 baranowb 2014-08-14 08:02:19 UTC
Assigned since commit did not make it. Needs respin of redhat-2. Thanks Kyle.

Comment 12 Katerina Odabasi 2014-08-29 08:22:33 UTC
Verified in EAP 6.3.1.CP.CR1.

Comment 13 JBoss JIRA Server 2014-09-16 21:10:05 UTC
Kyle Lape <kyle.lape> updated the status of jira RESTEASY-1080 to Resolved

Comment 15 JBoss JIRA Server 2016-08-02 16:15:28 UTC
Alessio Soldano <asoldano> updated the status of jira RESTEASY-1080 to Closed


Note You need to log in before you can comment on or make changes to this bug.