[
https://issues.apache.org/jira/browse/GEODE-8973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301953#comment-17301953
]
ASF subversion and git services commented on GEODE-8973:
--------------------------------------------------------
Commit 2dd6f6d8a4e9a67f310eebcacd9f2fdca55047b2 in geode-native's branch
refs/heads/develop from Mario Salazar de Torres
[ https://gitbox.apache.org/repos/asf?p=geode-native.git;h=2dd6f6d ]
GEODE-8973: Fix calls dup on exception handling (#763)
- Whenever calling throwExceptionIfError macro it can happen that calls
are duplicated. Hence the macro has been replaced by a inlined
function.
> 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)