Skip to content

Commit

Permalink
[C++] Extend internal TTL of libjoynr discovery proxy by 10s
Browse files Browse the repository at this point in the history
This prevents timeouts between libjoynr and the global capabilities directory.

Following assumptions are made:
 * the communication to the cluster-controller is way faster then the one from the
   cluster-controller to the backend (common case)
 * this value is greater then the TTL set on the cluster-controller side to communicate
   with the global capabilities directory
 * the cluster-controller uses as default value MessagingQos::default_ttl

Change-Id: If3a438a0d4159411281765388eb43fd049dadbed
  • Loading branch information
Donato Sciarra committed Sep 14, 2018
1 parent 6786f97 commit 991bec3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.cpp
Expand Up @@ -257,7 +257,15 @@ void LibJoynrRuntime::buildInternalProxies(
std::function<void()> onSuccess,
std::function<void(const joynr::exceptions::JoynrRuntimeException& error)> onError)
{
const std::uint64_t messagingTtl = 60000;
/*
* Extend the default ttl by 10 seconds in order to allow the cluster controller to handle
* timeout for global discovery requests and send back the response to discoveryProxy.
* This assumes that the communication to the cluster-controller is way faster then the one
* from the cluster-controller to the backend.
* This value should be greater then the TTL set on the cluster-controller side to communicate
* with the global capabilities directory (per default Messaging::default_ttl).
*/
const std::uint64_t messagingTtl = joynr::MessagingQos().getTtl() + 10000;
const MessagingQos joynrInternalMessagingQos(messagingTtl);
const bool isGloballyVisible = false;
constexpr std::int64_t expiryDateMs = std::numeric_limits<std::int64_t>::max();
Expand Down

0 comments on commit 991bec3

Please sign in to comment.