Repository: mesos Updated Branches: refs/heads/master 2685f1488 -> b571aff20
Fixed a linking issue with gRPC. Review: https://reviews.apache.org/r/68030/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b571aff2 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b571aff2 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b571aff2 Branch: refs/heads/master Commit: b571aff20ad0f7186eb448c884b9fc8e58c705ae Parents: 2685f14 Author: Jan Schlicht <[email protected]> Authored: Wed Jul 25 14:14:53 2018 -0700 Committer: Chun-Hung Hsiao <[email protected]> Committed: Wed Jul 25 14:19:52 2018 -0700 ---------------------------------------------------------------------- 3rdparty/libprocess/include/process/grpc.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/b571aff2/3rdparty/libprocess/include/process/grpc.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/include/process/grpc.hpp b/3rdparty/libprocess/include/process/grpc.hpp index 28a854f..28c9cad 100644 --- a/3rdparty/libprocess/include/process/grpc.hpp +++ b/3rdparty/libprocess/include/process/grpc.hpp @@ -207,9 +207,16 @@ public: context->set_wait_for_ready(options.wait_for_ready); - context->set_deadline( - std::chrono::system_clock::now() + - std::chrono::nanoseconds(options.timeout.ns())); + // We need to ensure that we're using a + // `std::chrono::system_clock::time_point` because `grpc::TimePoint` + // provides a specialization only for this type and we cannot + // guarantee that the operation below will always result in this type. + auto time_point = + std::chrono::time_point_cast<std::chrono::system_clock::duration>( + std::chrono::system_clock::now() + + std::chrono::nanoseconds(options.timeout.ns())); + + context->set_deadline(time_point); promise->future().onDiscard([=] { context->TryCancel(); });
