[jboss-jira] [JBoss JIRA] Closed: (JBRULES-2096) AbstractRuleBase.removeRule(String, String) does not release the lock when failing removing rule from the package

Mark Proctor (JIRA) jira-events at lists.jboss.org
Wed Jul 21 18:10:53 EDT 2010


     [ https://jira.jboss.org/browse/JBRULES-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor closed JBRULES-2096.
---------------------------------

      Assignee: Mark Proctor  (was: Edson Tirelli)
    Resolution: Out of Date


I checked the code, the finally does call unlock, so I think this is ok now:
{code}
    public void removeRule(final String packageName,
                           final String ruleName) {
        try {
            lock();
            final Package pkg = this.pkgs.get( packageName );
            if ( pkg == null ) {
                throw new IllegalArgumentException( "Package name '" + packageName + "' does not exist for this Rule Base." );
            }

            final Rule rule = pkg.getRule( ruleName );
            if ( rule == null ) {
                throw new IllegalArgumentException( "Rule name '" + ruleName + "' does not exist in the Package '" + packageName + "'." );
            }

            this.removalsSinceLock++;

            removeRule( pkg,
                        rule );
            pkg.removeRule( rule );
            if ( this.reloadPackageCompilationData == null ) {
                this.reloadPackageCompilationData = new ReloadPackageCompilationData();
            }
            this.reloadPackageCompilationData.addDialectDatas( pkg.getDialectRuntimeRegistry() );
        } finally {
            unlock();
        }
    }
{code}

> AbstractRuleBase.removeRule(String, String) does not release the lock when failing removing rule from the package
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-2096
>                 URL: https://jira.jboss.org/browse/JBRULES-2096
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 4.0.7
>         Environment: N/A
>            Reporter: Steinar Haugen
>            Assignee: Mark Proctor
>             Fix For: 5.1.0.CR1
>
>
> This issue is copy of 
> https://jira.jboss.org:8443/jira/browse/JBRULES-603
> Original text: 
> AbstractRuleBase.removeRule(String, String) locks the working memories before removing the rule from the package. However the actual operation of removing rules can fail with an exception which leaves the unlock operation bypassed. This will lock up all the working memories from that point on.
> The original issue has status "Resolved", but the fix has apparantly been rolled back. At least it is present in Drools version 4.0.7 (i.e. not encapsulated in try / finally).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list