diff options
author | Benoit Foucher <benoit@zeroc.com> | 2019-07-18 18:09:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-18 18:09:15 +0200 |
commit | 2c036ca6ca7f39b6987135839a1a899cd080877d (patch) | |
tree | 71b429a5784a77ec41084ba84105930f537f195e /cpp/test/Ice/interceptor/Client.cpp | |
parent | Bumped invocation timeout in Objectice-C timeout test (diff) | |
download | ice-2c036ca6ca7f39b6987135839a1a899cd080877d.tar.bz2 ice-2c036ca6ca7f39b6987135839a1a899cd080877d.tar.xz ice-2c036ca6ca7f39b6987135839a1a899cd080877d.zip |
Fixed non-thread safe AMD dispatch, fixes #448 (#449)
The caching of the output stream which was added back to solve #414 made the
dispatch of AMD requests non thread-safe if a dispatch interceptor was installed
and if the interceptor retried the dispatch. Multiple continuation could run
concurrently and eventually re-use the cached output stream to marshal multiple
responses.
Diffstat (limited to 'cpp/test/Ice/interceptor/Client.cpp')
-rw-r--r-- | cpp/test/Ice/interceptor/Client.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp index 191215fd59d..02317c19d2c 100644 --- a/cpp/test/Ice/interceptor/Client.cpp +++ b/cpp/test/Ice/interceptor/Client.cpp @@ -189,6 +189,16 @@ Client::runAmdTest(const Test::MyObjectPrxPtr& prx, const AMDInterceptorIPtr& in test(prx->amdAddWithRetry(33, 12) == 45); test(interceptor->getLastOperation() == "amdAddWithRetry"); test(!interceptor->getLastStatus()); + { + Ice::Context ctx; + ctx["retry"] = "yes"; + for(int i = 0; i < 10; ++i) + { + test(prx->amdAdd(33, 12, ctx) == 45); + test(interceptor->getLastOperation() == "amdAdd"); + test(!interceptor->getLastStatus()); + } + } cout << "ok" << endl; cout << "testing user exception... " << flush; try |