kgiusti commented on a change in pull request #658: DISPATCH-1540 - Set the 
pre-settled flag appropriately on a delivery …
URL: https://github.com/apache/qpid-dispatch/pull/658#discussion_r365850091
 
 

 ##########
 File path: src/router_core/delivery.c
 ##########
 @@ -201,8 +201,16 @@ void qdr_delivery_remote_state_updated(qdr_core_t *core, 
qdr_delivery_t *deliver
 }
 
 
-qdr_delivery_t *qdr_deliver_continue(qdr_core_t *core,qdr_delivery_t *in_dlv)
+qdr_delivery_t *qdr_deliver_continue(qdr_core_t *core,qdr_delivery_t *in_dlv, 
bool settled)
 {
+    //
+    // If the delivery is already pre-settled, don't do anything with the 
pre-settled flag.
+    //
+    // If the in_delivery was not pre-settled, you can go to pre-settled.
+    if (! in_dlv->presettled && settled) {
+        in_dlv->presettled = settled;
 
 Review comment:
   This is (technically) a possible race condition.  This method runs under the 
I/O thread which should not be modifying qdr_delivery_t state directly.
   
   It would be better to pass along the presettled flag in the action.   I 
suggest considering changing the existing code to use the action->args.delivery 
action structure (adding a pre-settled flag there) instead of the 
args.connection structure.

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


With regards,
Apache Git Services

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

Reply via email to