You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Kirk Chen (JIRA)" <se...@james.apache.org> on 2004/11/09 22:53:23 UTC

[jira] Created: (JSIEVE-10) Race condition in CommandStateManager

Race condition in CommandStateManager
-------------------------------------

         Key: JSIEVE-10
         URL: http://nagoya.apache.org/jira/browse/JSIEVE-10
     Project: jSieve
        Type: Bug
    Reporter: Kirk Chen



The resetInstance method in CommandStateManager should be synchronized. In multithreaded environment, I encountered the following exception:

java.lang.NullPointerException
        at org.apache.jsieve.commands.CommandStateManager.setInstance(CommandStateManager.java:122)
        at org.apache.jsieve.commands.CommandStateManager.updateInstance(CommandStateManager.java:140)
        at org.apache.jsieve.commands.CommandStateManager.getInstance(CommandStateManager.java:95)
        at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:145)
        at RuleManager.applyRules(RuleManager.java:87)
...

which should have been caused by the lack of it. I am yet to verify this theory, however. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Assigned: (JSIEVE-10) Race condition in CommandStateManager

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JSIEVE-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Burrell Donkin reassigned JSIEVE-10:
-------------------------------------------

    Assignee: Robert Burrell Donkin

> Race condition in CommandStateManager
> -------------------------------------
>
>                 Key: JSIEVE-10
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-10
>             Project: jSieve
>          Issue Type: Bug
>            Reporter: Kirk Chen
>            Assignee: Robert Burrell Donkin
>
> The resetInstance method in CommandStateManager should be synchronized. In multithreaded environment, I encountered the following exception:
> java.lang.NullPointerException
>         at org.apache.jsieve.commands.CommandStateManager.setInstance(CommandStateManager.java:122)
>         at org.apache.jsieve.commands.CommandStateManager.updateInstance(CommandStateManager.java:140)
>         at org.apache.jsieve.commands.CommandStateManager.getInstance(CommandStateManager.java:95)
>         at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:145)
>         at RuleManager.applyRules(RuleManager.java:87)
> ...
> which should have been caused by the lack of it. I am yet to verify this theory, however. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JSIEVE-10) Race condition in CommandStateManager

Posted by "Steve Brewin (JIRA)" <se...@james.apache.org>.
     [ http://nagoya.apache.org/jira/browse/JSIEVE-10?page=comments#action_55326 ]
     
Steve Brewin commented on JSIEVE-10:
------------------------------------

In truth all the Singletons should be synchronized learning from Double-checked locking and the Singleton pattern (http://www-106.ibm.com/developerworks/java/library/j-dcl.html?dwzone=java).

That they aren't is because by and large the Singletons represent an alpha level harness to access the core code. In the future I was thinking of using IOC (probably Hivemind) to assemble things in a much cleaner manner.

Still, I would be happy if someone wants to submit a patch to make the singletons thread safe.

-- Steve

> Race condition in CommandStateManager
> -------------------------------------
>
>          Key: JSIEVE-10
>          URL: http://nagoya.apache.org/jira/browse/JSIEVE-10
>      Project: jSieve
>         Type: Bug
>     Reporter: Kirk Chen

>
> The resetInstance method in CommandStateManager should be synchronized. In multithreaded environment, I encountered the following exception:
> java.lang.NullPointerException
>         at org.apache.jsieve.commands.CommandStateManager.setInstance(CommandStateManager.java:122)
>         at org.apache.jsieve.commands.CommandStateManager.updateInstance(CommandStateManager.java:140)
>         at org.apache.jsieve.commands.CommandStateManager.getInstance(CommandStateManager.java:95)
>         at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:145)
>         at RuleManager.applyRules(RuleManager.java:87)
> ...
> which should have been caused by the lack of it. I am yet to verify this theory, however. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Closed: (JSIEVE-10) Race condition in CommandStateManager

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JSIEVE-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Burrell Donkin closed JSIEVE-10.
---------------------------------------

    Resolution: Fixed

Commit fix

> Race condition in CommandStateManager
> -------------------------------------
>
>                 Key: JSIEVE-10
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-10
>             Project: jSieve
>          Issue Type: Bug
>            Reporter: Kirk Chen
>            Assignee: Robert Burrell Donkin
>
> The resetInstance method in CommandStateManager should be synchronized. In multithreaded environment, I encountered the following exception:
> java.lang.NullPointerException
>         at org.apache.jsieve.commands.CommandStateManager.setInstance(CommandStateManager.java:122)
>         at org.apache.jsieve.commands.CommandStateManager.updateInstance(CommandStateManager.java:140)
>         at org.apache.jsieve.commands.CommandStateManager.getInstance(CommandStateManager.java:95)
>         at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:145)
>         at RuleManager.applyRules(RuleManager.java:87)
> ...
> which should have been caused by the lack of it. I am yet to verify this theory, however. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org