You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/11/03 13:23:00 UTC

[jira] [Commented] (PROTON-2396) [cpp] Seed in uuid.cpp can lead to duplicates

    [ https://issues.apache.org/jira/browse/PROTON-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17438052#comment-17438052 ] 

ASF GitHub Bot commented on PROTON-2396:
----------------------------------------

DreamPearl opened a new pull request #340:
URL: https://github.com/apache/qpid-proton/pull/340


   [PROTON-2396](https://issues.apache.org/jira/browse/PROTON-2396?jql=resolution%20%3D%20Unresolved%20AND%20assignee%20%3D%20currentUser()%20AND%20project%20%3D%2012313720)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> [cpp] Seed in uuid.cpp can lead to duplicates
> ---------------------------------------------
>
>                 Key: PROTON-2396
>                 URL: https://issues.apache.org/jira/browse/PROTON-2396
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: cpp-binding
>         Environment: RHEL7 running in OpenStack
> docker-ce 19.03.5
> qpid-proton 0.28.0
> qpid-cpp 1.37.0
>            Reporter: Ryan Herbert
>            Assignee: Rakhi Kumari
>            Priority: Major
>
> The random number seed used in qpid-proton/cpp/src/uuid.cpp is based on the current time and the PID of the running process.  When starting multiple proton instances simultaneously in Docker containers via automated deployment, there is a high probability that multiple instances will get the same seed since the PID within the Docker container is consistent and the same across multiple copies of the same Docker container.
> This results in duplicate link names when binding to exchanges. When this happens, the queue gets bound to two different exchanges, and requests sent to one exchange will get responses from both services.
> To work around this error, we are specifying the link name via sender_options/receiver_options every time we open a new sender/receiver, and we also specify the container_id in connection_options.  We are using std::mt19937_64 seeded with std::chrono::system_clock::now().time_since_epoch().count() to generate the random part of our link names, which seems to have enough randomness that it has eliminated the problem for us.
> As pointed out in the Proton user forum, std::random_device is probably a better choice for initializing the seed.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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