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

ASF GitHub Bot commented on GEODE-8973:
---------------------------------------

pdxcodemonkey merged pull request #763:
URL: https://github.com/apache/geode-native/pull/763


   


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


> Error handling might cause calls to be duplicated
> -------------------------------------------------
>
>                 Key: GEODE-8973
>                 URL: https://issues.apache.org/jira/browse/GEODE-8973
>             Project: Geode
>          Issue Type: Bug
>          Components: native client
>    Affects Versions: 1.14.0
>            Reporter: Mario Salazar de Torres
>            Assignee: Mario Salazar de Torres
>            Priority: Major
>              Labels: pull-request-available
>
> **When using throwExceptionIfError macro if any of its parameter is a call
>  then such call could be duplicated and in the case of the error there are 
> cases within ThinClientPoolDM that could lead to requests duplications and 
> inconsistencies.
> ----
> One from *ThinClientPoolDM::AddPdxType* example is 
> {code:java}
> throwExceptionIfError("Operation Failed", sendSyncRequest(request, 
> reply));{code}
> Thing is that the pre-processor just replaces expressions, so if one of the 
> macro parameters is passed a function call, this is not executed prior to 
> evaluating the macro, leading to potential duplicities.
> This is one of the reasons why using macros are dis-recommended by C++ 
> standard comittee and they should eventually be removed.
> You can find here an illustrative example, in which, assembly shows the call 
> is duplicated: https://godbolt.org/z/oc4hG9



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

Reply via email to