[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-05-11 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on PROTON-2377:
-

Commit ea627e71ef2e6247b5a813a4b21293775ba1b21e in qpid-proton's branch 
refs/heads/main from dreampearl
[ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=ea627e7 ]

PROTON-2377: [cpp] Make tag_counter in sender.cpp atomic


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-05-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


astitcher merged pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310


   


-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-26 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


jiridanek commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r619690023



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   It's what I meant. Let's wait what Andrew thinks, as the cpp binding 
maintainer...




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-24 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


jiridanek commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r619690023



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   It's what I meant. Let's wait what Andrew thinks, as the cpp binding 
maintainer...




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


DreamPearl commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618682920



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   I've made the changes. Can you please check if this is what you meant?




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


gemmellr commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618593227



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   > Is it true that the delivery tags are only scoped to the sender then. 
So that different senders can use identical tags?
   
   Yes, tags are only used in the scope of a particular link, so they only need 
to be unique for the outstanding set of unsettled deliveries on that link:
   
   "The delivery-tag MUST be unique amongst all deliveries that could be 
considered unsettled by either end of the link. "
   
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-idp438000
   
   "Uniquely identifies the delivery attempt for a given message on this link."
   
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-transfer
   




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


gemmellr commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618594097



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   
   >To be clear if we can make the tag counter scoped to the connection or 
lower then we don't need any thread synchronisation at all. This is because it 
is an underlying assumption in proton that a connection can only be processed 
on a single thread at a time.
   
   Yep, thats what pompted my original reply on the other PR, when I thought 
the variable was sender-specific, before it was pointed out it was actually a 
global variable.




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


gemmellr commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618593227



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   > Is it true that the delivery tags are only scoped to the sender then. 
So that different senders can use identical tags?
   
   Yes, tags are only used in the scope of a particular link, so they only need 
to be unique for the outstanding set of unsettled deliveries on that link:
   
   "The delivery-tag MUST be unique amongst all deliveries that could be 
considered unsettled by either end of the link. "
   
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-idp438000
   




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


astitcher commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618556498



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   To be clear if we can make the tag counter scoped to the connection or 
lower then we don't need any thread synchronisation at all. This is because it 
is an underlying assumption in proton that a connection can only be processed 
on a single thread at a time.




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


astitcher commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618554739



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   It would make a lot of sense (from a performance stand point) to have 
the tag counter be scoped to the connection in some way (as this is the 
serialisation granule of proton).
   Is it true that the delivery tags are only scoped to the sender then. So 
that different senders can use identical tags? if so we should just make this 
connection or more granularly scoped and just zero out the count when we create 
a new connection/session/sender/etc.




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


gemmellr commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618516574



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   I would probably lean toward a sender-specific value as well, though 
both ways have their own advantages.
   
   @astitcher ? @ssorj ?




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


DreamPearl commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618314415



##
File path: cpp/include/proton/delivery.hpp
##
@@ -64,6 +65,9 @@ class delivery : public transfer {
 /// Settle with MODIFIED state.
 PN_CPP_EXTERN void modify();
 
+/// Return the tag for this delivery.
+PN_CPP_EXTERN binary tag() const;

Review comment:
   Just did that. Thanks.




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


jiridanek commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618311040



##
File path: cpp/include/proton/delivery.hpp
##
@@ -64,6 +65,9 @@ class delivery : public transfer {
 /// Settle with MODIFIED state.
 PN_CPP_EXTERN void modify();
 
+/// Return the tag for this delivery.
+PN_CPP_EXTERN binary tag() const;

Review comment:
   You should rebase your PR branch on top of `main`, to get rid of this 
(already merged) code. Or you can just delete the commit from the branch; 
whichever you find simpler.




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


jiridanek commented on a change in pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#discussion_r618311500



##
File path: cpp/src/sender.cpp
##
@@ -60,14 +61,20 @@ class target sender::target() const {
 }
 
 namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
+std::atomic tag_counter(0);

Review comment:
   This would of course work. I was also thinking about maybe making the 
counter be an instance variable of a `sender`. Let's see what others think 
first.




-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


codecov-commenter edited a comment on pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#issuecomment-824744524






-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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



[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


codecov-commenter commented on pull request #310:
URL: https://github.com/apache/qpid-proton/pull/310#issuecomment-824744524


   # 
[Codecov](https://codecov.io/gh/apache/qpid-proton/pull/310?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#310](https://codecov.io/gh/apache/qpid-proton/pull/310?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (280a703) into 
[main](https://codecov.io/gh/apache/qpid-proton/commit/19ae83a1ef3ecf34c34aae72f2a6a878f138749c?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (19ae83a) will **increase** coverage by `10.71%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 280a703 differs from pull request most recent 
head f2dc7b2. Consider uploading reports for the commit f2dc7b2 to get more 
accurate results
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/qpid-proton/pull/310/graphs/tree.svg?width=650=150=pr=UKKzV9XnFF_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/qpid-proton/pull/310?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@ Coverage Diff @@
   ## main #310   +/-   ##
   ===
   + Coverage   69.03%   79.75%   +10.71% 
   ===
 Files 351   46  -305 
 Lines   69481 2341-67140 
   ===
   - Hits47967 1867-46100 
   + Misses  21514  474-21040 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/qpid-proton/pull/310?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[ruby/lib/handler/reactor\_messaging\_adapter.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvaGFuZGxlci9yZWFjdG9yX21lc3NhZ2luZ19hZGFwdGVyLnJi)
 | `32.55% <0.00%> (-58.14%)` | :arrow_down: |
   | 
[ruby/lib/handler/messaging\_handler.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvaGFuZGxlci9tZXNzYWdpbmdfaGFuZGxlci5yYg==)
 | `57.14% <0.00%> (-35.72%)` | :arrow_down: |
   | 
[ruby/lib/core/message.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvY29yZS9tZXNzYWdlLnJi)
 | `56.47% <0.00%> (-32.36%)` | :arrow_down: |
   | 
[ruby/lib/util/deprecation.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvdXRpbC9kZXByZWNhdGlvbi5yYg==)
 | `70.58% <0.00%> (-29.42%)` | :arrow_down: |
   | 
[ruby/lib/util/error\_handler.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvdXRpbC9lcnJvcl9oYW5kbGVyLnJi)
 | `59.37% <0.00%> (-28.13%)` | :arrow_down: |
   | 
[ruby/lib/codec/data.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvY29kZWMvZGF0YS5yYg==)
 | `69.56% <0.00%> (-26.53%)` | :arrow_down: |
   | 
[ruby/lib/core/uri.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvY29yZS91cmkucmI=)
 | `74.07% <0.00%> (-25.93%)` | :arrow_down: |
   | 
[ruby/lib/core/condition.rb](https://codecov.io/gh/apache/qpid-proton/pull/310/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cnVieS9saWIvY29yZS9jb25kaXRpb24ucmI=)
 | `80.64% <0.00%> (-19.36%)` | :arrow_down: |
   | 

[jira] [Commented] (PROTON-2377) [cpp] tag_counter is not used in a thread safe way in sender.cpp

2021-04-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on PROTON-2377:


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


   Issue: https://issues.apache.org/jira/browse/PROTON-2377 


-- 
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.

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


> [cpp] tag_counter is not used in a thread safe way in sender.cpp
> 
>
> Key: PROTON-2377
> URL: https://issues.apache.org/jira/browse/PROTON-2377
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Reporter: Rakhi Kumari
>Priority: Major
>
> uint64_t tag_counter = 0 is a global variable, so it might end up giving 
> duplicate ids to different threads.
> We need to ensure that a single sender will not send a message with a 
> duplicate tag. Thread safety is required to guarantee unique tags. 
> Link to the discussion regarding this issue :
> https://github.com/apache/qpid-proton/pull/309#discussion_r615219442



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

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