You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Julien Lavigne du Cadet (JIRA)" <qp...@incubator.apache.org> on 2009/07/06 19:01:14 UTC

[jira] Created: (QPID-1972) UUID.randomUUID() is not thread-safe

UUID.randomUUID() is not thread-safe
------------------------------------

                 Key: QPID-1972
                 URL: https://issues.apache.org/jira/browse/QPID-1972
             Project: Qpid
          Issue Type: Bug
          Components: Dot Net Client
    Affects Versions: 0.5
         Environment: .net API
            Reporter: Julien Lavigne du Cadet
            Priority: Critical


UUID.randomUUID is not thread-safe because it's using a static random object.
However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.

Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.

Please note that this patch is BREAKING COMPABILITY with previous versions of the API !

The patch is also fixing 2 others issues : 
- test.config is not included in the unit test project which result in half of the unit tests failing 
- the management console is not compiling with vs 2008 and .Net 2.0



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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-1972) UUID.randomUUID() is not thread-safe

Posted by "Julien Lavigne du Cadet (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Lavigne du Cadet updated QPID-1972:
------------------------------------------

    Attachment:     (was: qpid-dotnet.patch)

> UUID.randomUUID() is not thread-safe
> ------------------------------------
>
>                 Key: QPID-1972
>                 URL: https://issues.apache.org/jira/browse/QPID-1972
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>    Affects Versions: 0.5
>         Environment: .net API
>            Reporter: Julien Lavigne du Cadet
>            Priority: Critical
>
> UUID.randomUUID is not thread-safe because it's using a static random object.
> However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.
> Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.
> Please note that this patch is BREAKING COMPABILITY with previous versions of the API !
> The patch is also fixing 2 others issues : 
> - test.config is not included in the unit test project which result in half of the unit tests failing 
> - the management console is not compiling with vs 2008 and .Net 2.0

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Resolved: (QPID-1972) UUID.randomUUID() is not thread-safe

Posted by "Aidan Skinner (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aidan Skinner resolved QPID-1972.
---------------------------------

    Resolution: Fixed

I've applied Julien's patch from QPID-1987

> UUID.randomUUID() is not thread-safe
> ------------------------------------
>
>                 Key: QPID-1972
>                 URL: https://issues.apache.org/jira/browse/QPID-1972
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>    Affects Versions: M3, M4, 0.5
>         Environment: .net API
>            Reporter: Julien Lavigne du Cadet
>            Priority: Critical
>             Fix For: 0.6
>
>
> UUID.randomUUID is not thread-safe because it's using a static random object.
> However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.
> Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.
> Please note that this patch is BREAKING COMPABILITY with previous versions of the API !
> The patch is also fixing 2 others issues : 
> - test.config is not included in the unit test project which result in half of the unit tests failing 
> - the management console is not compiling with vs 2008 and .Net 2.0

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-1972) UUID.randomUUID() is not thread-safe

Posted by "Julien Lavigne du Cadet (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730769#action_12730769 ] 

Julien Lavigne du Cadet commented on QPID-1972:
-----------------------------------------------

Please do not consider this patch for now, there are issues with it.

> UUID.randomUUID() is not thread-safe
> ------------------------------------
>
>                 Key: QPID-1972
>                 URL: https://issues.apache.org/jira/browse/QPID-1972
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>    Affects Versions: 0.5
>         Environment: .net API
>            Reporter: Julien Lavigne du Cadet
>            Priority: Critical
>         Attachments: qpid-dotnet.patch
>
>
> UUID.randomUUID is not thread-safe because it's using a static random object.
> However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.
> Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.
> Please note that this patch is BREAKING COMPABILITY with previous versions of the API !
> The patch is also fixing 2 others issues : 
> - test.config is not included in the unit test project which result in half of the unit tests failing 
> - the management console is not compiling with vs 2008 and .Net 2.0

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-1972) UUID.randomUUID() is not thread-safe

Posted by "Aidan Skinner (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aidan Skinner updated QPID-1972:
--------------------------------

    Affects Version/s: M3
                       M4
        Fix Version/s: 0.6

> UUID.randomUUID() is not thread-safe
> ------------------------------------
>
>                 Key: QPID-1972
>                 URL: https://issues.apache.org/jira/browse/QPID-1972
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>    Affects Versions: M3, M4, 0.5
>         Environment: .net API
>            Reporter: Julien Lavigne du Cadet
>            Priority: Critical
>             Fix For: 0.6
>
>
> UUID.randomUUID is not thread-safe because it's using a static random object.
> However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.
> Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.
> Please note that this patch is BREAKING COMPABILITY with previous versions of the API !
> The patch is also fixing 2 others issues : 
> - test.config is not included in the unit test project which result in half of the unit tests failing 
> - the management console is not compiling with vs 2008 and .Net 2.0

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-1972) UUID.randomUUID() is not thread-safe

Posted by "Julien Lavigne du Cadet (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Lavigne du Cadet updated QPID-1972:
------------------------------------------

    Attachment: qpid-dotnet.patch

The patch

> UUID.randomUUID() is not thread-safe
> ------------------------------------
>
>                 Key: QPID-1972
>                 URL: https://issues.apache.org/jira/browse/QPID-1972
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>    Affects Versions: 0.5
>         Environment: .net API
>            Reporter: Julien Lavigne du Cadet
>            Priority: Critical
>         Attachments: qpid-dotnet.patch
>
>
> UUID.randomUUID is not thread-safe because it's using a static random object.
> However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.
> Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.
> Please note that this patch is BREAKING COMPABILITY with previous versions of the API !
> The patch is also fixing 2 others issues : 
> - test.config is not included in the unit test project which result in half of the unit tests failing 
> - the management console is not compiling with vs 2008 and .Net 2.0

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org