[rules-users] Open file leak in Drools Compiler

Chris Selwyn chris at selwyn-family.me.uk
Thu Mar 17 05:56:39 EDT 2011


Done... https://issues.jboss.org/browse/JBRULES-2928

Chris

On 16/03/2011 18:33, Edson Tirelli wrote:
>
>    This is JCI code that we inline. We should probably check if there 
> is a new JCI version that fixes the problem if it is indeed a problem.
>
>    Can I ask you please to open a JIRA with the info you reported here?
>
>    Thanks,
>       Edson
>
> 2011/3/16 Greg Barton <greg_barton at yahoo.com 
> <mailto:greg_barton at yahoo.com>>
>
>     Yes, but it's not a full blown leak.  Wrapping stream use in a
>     try/finally block is best.  Feel free and open a JIRA to fix it.
>      There may be other instances.
>
>     --- On Wed, 3/16/11, Chris Selwyn <chris at selwyn-family.me.uk
>     <mailto:chris at selwyn-family.me.uk>> wrote:
>
>     > From: Chris Selwyn <chris at selwyn-family.me.uk
>     <mailto:chris at selwyn-family.me.uk>>
>     > Subject: Re: [rules-users] Open file leak in Drools Compiler
>     > To: "Rules Users List" <rules-users at lists.jboss.org
>     <mailto:rules-users at lists.jboss.org>>
>     > Cc: "Greg Barton" <greg_barton at yahoo.com
>     <mailto:greg_barton at yahoo.com>>
>     > Date: Wednesday, March 16, 2011, 12:18 PM
>     > Isn't it regarded as bad practice to
>     > rely on the finalize() method
>     > called by the garbage collector to release such resources?
>     >
>     > Chris
>     >
>     > On 16/03/2011 17:04, Greg Barton wrote:
>     > > Only if garbage collection never runs.  Then
>     > you'd already be in trouble. :)
>     > >
>     > > --- On Wed, 3/16/11, Chris Selwyn<chris at selwyn-family.me.uk
>     <mailto:chris at selwyn-family.me.uk>>
>     > wrote:
>     > >
>     > >> From: Chris Selwyn<chris at selwyn-family.me.uk
>     <mailto:chris at selwyn-family.me.uk>>
>     > >> Subject: [rules-users] Open file leak in Drools
>     > Compiler
>     > >> To: "Drools users"<rules-users at lists.jboss.org
>     <mailto:rules-users at lists.jboss.org>>
>     > >> Date: Wednesday, March 16, 2011, 11:49 AM
>     > >> I am running Drools (actually JBoss
>     > >> Rules 5.1.0 ) in Glassfish.
>     > >>
>     > >> My deployable is an EJB that uses a
>     > >> StatelessKnowledgeSession to run
>     > >> some rules that I get from a KnowledgeAgent that
>     > has a
>     > >> Changeset with a
>     > >> .drl in it.
>     > >> Therefore, I have placed the drools compiler into
>     > the
>     > >> deployable and it
>     > >> all appears to work.
>     > >>
>     > >> Glassfish has a clever little mechanism that, when
>     > you
>     > >> unload a
>     > >> deployable that had some open streams, it tells
>     > you all
>     > >> about it (and
>     > >> kindly closes them).
>     > >>
>     > >> Glassfish is reporting that InputStreams are being
>     > left
>     > >> open that were
>     > >> opened in the isPackage() method of
>     > >>
>     > org.drools.commons.jci.compilers.EclipseJavaCompiler.
>     > >> That method has the following code in it:-
>     > >>
>     > >>
>     >
>     > >>     final InputStream is =
>     > >>
>     >
>     pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName));
>     > >>
>     >
>     > >>     if (is != null) {
>     > >>
>     >
>     > >>       return false;
>     > >>
>     >
>     > >>     }
>     > >>
>     > >> So, when "is" is not null (i.e. open), it is
>     > forgotten
>     > >> about and not closed.
>     > >>
>     > >> Isn't this a potential file handle leak?
>     > >>
>     > >> Chris Selwyn
>     > >>
>     > >> _______________________________________________
>     > >> rules-users mailing list
>     > >> rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>     > >> https://lists.jboss.org/mailman/listinfo/rules-users
>     > >>
>     > >
>     > >
>     > >
>     > > _______________________________________________
>     > > rules-users mailing list
>     > > rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>     > > https://lists.jboss.org/mailman/listinfo/rules-users
>     > >
>     > >
>     > > -----
>     > > No virus found in this message.
>     > > Checked by AVG - www.avg.com <http://www.avg.com>
>     > > Version: 10.0.1204 / Virus Database: 1498/3509 -
>     > Release Date: 03/15/11
>     > >
>     >
>
>
>
>
>     _______________________________________________
>     rules-users mailing list
>     rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> -- 
>   Edson Tirelli
>   JBoss Drools Core Development
>   JBoss by Red Hat @ www.jboss.com <http://www.jboss.com>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 10.0.1204 / Virus Database: 1498/3511 - Release Date: 03/16/11
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110317/8e4a8fef/attachment.html 


More information about the rules-users mailing list