Skip to content

Commit

Permalink
Used a real UPID to send LearnedMessage.
Browse files Browse the repository at this point in the history
Previously an empty UPID `@0.0.0.0:0` was used which could result in
the message being dropped due to certain security check (MESOS-7401).

Review: https://reviews.apache.org/r/60917
  • Loading branch information
xujyan committed Jul 18, 2017
1 parent 1e4f30e commit d5b85d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/log/network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class NetworkProcess : public ProtobufProcess<NetworkProcess>
return watch->promise.future();
}

// Sends a request to each of the groups members and returns a set
// Sends a request to each of the group members and returns a set
// of futures that represent their responses.
template <typename Req, typename Res>
std::set<process::Future<Res>> broadcast(
Expand All @@ -235,6 +235,7 @@ class NetworkProcess : public ProtobufProcess<NetworkProcess>
return futures;
}

// Sends a request to each of the group members without expecting responses.
template <typename M>
Nothing broadcast(
const M& m,
Expand All @@ -244,7 +245,10 @@ class NetworkProcess : public ProtobufProcess<NetworkProcess>
for (iterator = pids.begin(); iterator != pids.end(); ++iterator) {
const process::UPID& pid = *iterator;
if (filter.count(pid) == 0) {
process::post(pid, m);
// NOTE: Here we just use the pid of the network to send this message
// since we don't need to deliver responses back to the caller. Any
// incoming messages addressed to the network are simply dropped.
process::post(self(), pid, m);
}
}
return Nothing();
Expand Down

0 comments on commit d5b85d2

Please sign in to comment.