You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by "Michael Stevens (JIRA)" <ji...@apache.org> on 2007/03/18 16:33:09 UTC

[jira] Created: (JCS-21) JCS has inconsistent locking of shared data

JCS has inconsistent locking of shared data
-------------------------------------------

                 Key: JCS-21
                 URL: https://issues.apache.org/jira/browse/JCS-21
             Project: JCS
          Issue Type: Bug
    Affects Versions: jcs-1.2.7.9.2
            Reporter: Michael Stevens
         Assigned To: Aaron Smuts
         Attachments: locking.diff

I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).

One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.

I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.

I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


[jira] Commented: (JCS-21) JCS has inconsistent locking of shared data

Posted by "Aaron Smuts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481974 ] 

Aaron Smuts commented on JCS-21:
--------------------------------

Find bugs is not perfect at locating sync problems.  Far from it.  I'll have to look at the changes.   I've never seen it acurately loate a synchronization problem.

> JCS has inconsistent locking of shared data
> -------------------------------------------
>
>                 Key: JCS-21
>                 URL: https://issues.apache.org/jira/browse/JCS-21
>             Project: JCS
>          Issue Type: Bug
>    Affects Versions: jcs-1.2.7.9.2
>            Reporter: Michael Stevens
>         Assigned To: Aaron Smuts
>         Attachments: locking.diff
>
>
> I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).
> One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.
> I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.
> I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


[jira] Resolved: (JCS-21) JCS has inconsistent locking of shared data

Posted by "Aaron Smuts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Smuts resolved JCS-21.
----------------------------

    Resolution: Fixed

I applied all the changes except for some private method changes and the optimization method on the indexed disk cache.  

> JCS has inconsistent locking of shared data
> -------------------------------------------
>
>                 Key: JCS-21
>                 URL: https://issues.apache.org/jira/browse/JCS-21
>             Project: JCS
>          Issue Type: Bug
>    Affects Versions: jcs-1.2.7.9.2
>            Reporter: Michael Stevens
>         Assigned To: Aaron Smuts
>         Attachments: locking.diff
>
>
> I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).
> One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.
> I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.
> I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


[jira] Updated: (JCS-21) JCS has inconsistent locking of shared data

Posted by "Michael Stevens (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Stevens updated JCS-21:
-------------------------------

    Attachment: locking.diff

patch to jcs locking code

> JCS has inconsistent locking of shared data
> -------------------------------------------
>
>                 Key: JCS-21
>                 URL: https://issues.apache.org/jira/browse/JCS-21
>             Project: JCS
>          Issue Type: Bug
>    Affects Versions: jcs-1.2.7.9.2
>            Reporter: Michael Stevens
>         Assigned To: Aaron Smuts
>         Attachments: locking.diff
>
>
> I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).
> One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.
> I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.
> I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


[jira] Closed: (JCS-21) JCS has inconsistent locking of shared data

Posted by "Aaron Smuts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Smuts closed JCS-21.
--------------------------


> JCS has inconsistent locking of shared data
> -------------------------------------------
>
>                 Key: JCS-21
>                 URL: https://issues.apache.org/jira/browse/JCS-21
>             Project: JCS
>          Issue Type: Bug
>    Affects Versions: jcs-1.2.7.9.2
>            Reporter: Michael Stevens
>            Assignee: Aaron Smuts
>         Attachments: locking.diff
>
>
> I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).
> One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.
> I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.
> I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


[jira] Commented: (JCS-21) JCS has inconsistent locking of shared data

Posted by "Aaron Smuts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481977 ] 

Aaron Smuts commented on JCS-21:
--------------------------------

I think some of these are legitimate, but not practical problems since they are on non used methods, etc.  I'll update with more details as I go over the list.

> JCS has inconsistent locking of shared data
> -------------------------------------------
>
>                 Key: JCS-21
>                 URL: https://issues.apache.org/jira/browse/JCS-21
>             Project: JCS
>          Issue Type: Bug
>    Affects Versions: jcs-1.2.7.9.2
>            Reporter: Michael Stevens
>         Assigned To: Aaron Smuts
>         Attachments: locking.diff
>
>
> I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).
> One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.
> I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.
> I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


[jira] Commented: (JCS-21) JCS has inconsistent locking of shared data

Posted by "Michael Stevens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481975 ] 

Michael Stevens commented on JCS-21:
------------------------------------

The principle I followed in the changes, which I suspect from the code you may disagree with, is that if you're sometimes locking access to a field, you always need to.

> JCS has inconsistent locking of shared data
> -------------------------------------------
>
>                 Key: JCS-21
>                 URL: https://issues.apache.org/jira/browse/JCS-21
>             Project: JCS
>          Issue Type: Bug
>    Affects Versions: jcs-1.2.7.9.2
>            Reporter: Michael Stevens
>         Assigned To: Aaron Smuts
>         Attachments: locking.diff
>
>
> I've been looking at the trunk JCS code with findbugs (http://findbugs.sf.net/).
> One of the things it does is warn when data is inconsistently synchronized - ie when it is sometimes referenced inside a synchronized block and sometimes not. This is not threadsafe - one thread may read old or inconsistent data.
> I've patched all the places findbugs complains about by adding appropriate synchronized() blocks.
> I suspect this change may require some discussion :)

-- 
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: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org