Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1066199

Summary: Missing stream close on UrlResource.cacheStream()
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Toshiya Kobayashi <tkobayas>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: BRMS 5.3.1CC: nwallace
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:35:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1080634    
Attachments:
Description Flags
UrlResource.java none

Description Toshiya Kobayashi 2014-02-18 01:47:07 UTC
Description of problem:

UrlResource.cacheStream() fails to close streams on exception.

Pull request
https://github.com/droolsjbpm/drools/pull/312


Steps to Reproduce:

I don't have verification steps for this. But I think testing BZ1034030 would be good to confirm that this fix doesn't break the behaviour.

https://bugzilla.redhat.com/show_bug.cgi?id=1034030

Comment 1 Toshiya Kobayashi 2014-03-13 01:24:22 UTC
Please wait for applying the above PR. I'll create another PR after BZ1075293 (https://github.com/droolsjbpm/drools/pull/322) is accepted.

Comment 2 Toshiya Kobayashi 2014-04-07 10:47:27 UTC
Created attachment 883571 [details]
UrlResource.java

Attached UrlResource.java which is written on top of https://github.com/droolsjbpm/drools/pull/322

Once the PR#322 is merged into 5.3.x branch, I can create a pull request for this BZ so feel free to let me know. But the change is only for UrlResource.cacheStream() so you may be able to commit referring this java file.

I have changed cacheStream() to throw IOException but I'm not sure if it is a good idea. The original implementation catches and hides all Exceptions. Please review and choose the best way. The main purpose of this BZ is closing stream.

Thanks!

Comment 3 Toshiya Kobayashi 2014-04-07 10:51:00 UTC
# Please note that we have to close FileOutputStream (fout.close()) before renaming (fi.renameTo(cacheFile)). If not, Windows fails to rename.

Comment 4 Mario Fusco 2014-04-23 08:24:21 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/e9f2169e6

Comment 5 Marek Winkler 2014-07-17 15:22:33 UTC
Verified on 5.3.1.BRMS-P06.

Comment 8 Red Hat Bugzilla 2025-02-10 03:35:07 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.