Skip to content

Conversation

@tadayosi
Copy link
Member

@tadayosi tadayosi commented Oct 26, 2016

https://issues.apache.org/jira/browse/CXF-7109
https://issues.jboss.org/browse/ENTESB-6136

I think the best way to make a client callback invoked once and only once is to remove from the exchange immediately after its handle***() method is invoked once. It should prevent a client callback from being called more than once not only for the CXF-7109 case but also for any other potential cases where the callback may be invoked more than once accidentally.

I added remove(Class<T>) to Exchange (StringMap) for convenience and symmetry. It is necessary to remove the callback right before calling its handle***(), as otherwise some other thread may grab it concurrently before the current thread invokes handle***().

I also added a test case AsyncHTTPConduitTest#testCallAsyncCallbackInvokedOnlyOnce(), but please note this test fails only on RHEL 6.8 even without this fix. In order to check if this fix is really effective, you need to run the test on RHEL 6.8 to compare the results.

@asfgit asfgit merged commit 4eb81d3 into apache:master Oct 26, 2016
rnetuka pushed a commit to rnetuka/cxf that referenced this pull request Oct 3, 2022
Separate the jaxb properties so that PME replacement does not change …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants