Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1122779 - [GSS] (6.3.1) DataSourceProvider does not delete the temporary files it creates
[GSS] (6.3.1) DataSourceProvider does not delete the temporary files it creates
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: RESTEasy (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity urgent
: CR1
: EAP 6.3.1
Assigned To: Weinan Li
Katerina Odabasi
: Triaged
Depends On: 1113338
Blocks: eap631-blockers/eap631-payload/eap63-cp01-blockers 1105695
  Show dependency treegraph
 
Reported: 2014-07-24 00:31 EDT by Kyle Lape
Modified: 2017-10-09 20:13 EDT (History)
7 users (show)

See Also:
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.
Story Points: ---
Clone Of: 1113338
Environment:
Last Closed: 2014-10-13 14:37:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker RESTEASY-1080 Major Closed DataSourceProvider does not delete the temporary files it creates 2016-08-02 12:15 EDT

  None (edit)
Description Kyle Lape 2014-07-24 00:31:26 EDT
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 17:16:44 EDT
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 07:49:55 EDT
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 00:55:13 EDT
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 01:38:29 EDT
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 04:02:04 EDT
(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 04:02:19 EDT
Assigned since commit did not make it. Needs respin of redhat-2. Thanks Kyle.
Comment 12 Katerina Odabasi 2014-08-29 04:22:33 EDT
Verified in EAP 6.3.1.CP.CR1.
Comment 13 JBoss JIRA Server 2014-09-16 17:10:05 EDT
Kyle Lape <kyle.lape@redhat.com> updated the status of jira RESTEASY-1080 to Resolved
Comment 15 JBoss JIRA Server 2016-08-02 12:15:28 EDT
Alessio Soldano <asoldano@redhat.com> 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.