This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch feature/promise_timeout_memleak
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to
refs/heads/feature/promise_timeout_memleak by this push:
new 87456ec Removes now unneeded promise timeout workaround
87456ec is described below
commit 87456ec33260d74a3dd014105f4762da8a21c3db
Author: Pepijn Noltes <[email protected]>
AuthorDate: Tue Sep 7 20:30:39 2021 +0200
Removes now unneeded promise timeout workaround
---
.../integration/src/TestExportImportRemoteServiceFactory.cc | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git
a/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc
b/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc
index a0b7d9a..de04155 100644
---
a/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc
+++
b/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc
@@ -29,7 +29,7 @@
#include "pubsub/publisher.h"
#include "pubsub/subscriber.h"
-constexpr auto INVOKE_TIMEOUT = std::chrono::seconds{5}; //TODO make
configurable
+constexpr auto INVOKE_TIMEOUT = std::chrono::seconds{10};
struct Calculator$add$Invoke {
double arg1{};
@@ -90,14 +90,7 @@ public:
logHelper.error(msg);
deferred.fail(celix::rsa::RemoteServicesException{msg});
}
- return
deferred.getPromise().setTimeout(INVOKE_TIMEOUT).onFailure([this,
invokeId](const auto& /*exp*/) {
- std::lock_guard l{mutex};
- auto it = deferreds.find(invokeId);
- if (it != deferreds.end()) {
-
it->second.fail(celix::rsa::RemoteServicesException{"workaround for unresovled
promsise with timeout chain memleak"});
- }
- deferreds.erase(invokeId);
- });
+ return deferred.getPromise().setTimeout(INVOKE_TIMEOUT);
}
void receive(const char *msgType, unsigned int msgTypeId, void *msg, const
celix_properties_t* meta) {