[
https://issues.apache.org/jira/browse/GEODE-8973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated GEODE-8973:
----------------------------------
Labels: pull-request-available (was: )
> 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)