| 975 | } |
| 976 | |
| 977 | void statusUpdate( |
| 978 | const UPID& from, |
| 979 | const StatusUpdate& update, |
| 980 | const UPID& pid) |
| 981 | { |
| 982 | if (!running.load()) { |
| 983 | VLOG(1) << "Ignoring task status update message because " |
| 984 | << "the driver is not running!"; |
| 985 | return; |
| 986 | } |
| 987 | |
| 988 | // Allow status updates created from the driver itself. |
| 989 | if (from != UPID()) { |
| 990 | if (!connected) { |
| 991 | VLOG(1) << "Ignoring status update message because the driver is " |
| 992 | << "disconnected!"; |
| 993 | return; |
| 994 | } |
| 995 | |
| 996 | CHECK_SOME(master); |
| 997 | |
| 998 | if (from != master->pid()) { |
| 999 | VLOG(1) << "Ignoring status update message because it was sent " |
| 1000 | << "from '" << from << "' instead of the leading master '" |
| 1001 | << master->pid() << "'"; |
| 1002 | return; |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | VLOG(2) << "Received status update " << update << " from " << pid; |
| 1007 | |
| 1008 | CHECK(framework.id() == update.framework_id()); |
| 1009 | |
| 1010 | // TODO(benh): Note that this maybe a duplicate status update! |
| 1011 | // Once we get support to try and have a more consistent view |
| 1012 | // of what's running in the cluster, we'll just let this one |
| 1013 | // slide. The alternative is possibly dealing with a scheduler |
| 1014 | // failover and not correctly giving the scheduler it's status |
| 1015 | // update, which seems worse than giving a status update |
| 1016 | // multiple times (of course, if a scheduler re-uses a TaskID, |
| 1017 | // that could be bad. |
| 1018 | |
| 1019 | TaskStatus status = update.status(); |
| 1020 | |
| 1021 | // If the update does not have a 'uuid', it does not need |
| 1022 | // acknowledging. However, prior to 0.23.0, the update uuid |
| 1023 | // was required and always set. In 0.24.0, we can rely on the |
| 1024 | // update uuid check here, until then we must still check for |
| 1025 | // this being sent from the driver (from == UPID()) or from |
| 1026 | // the master (pid == UPID()). |
| 1027 | // |
| 1028 | // TODO(vinod): Get rid of this logic in 0.27.0 because master |
| 1029 | // correctly sets task status since 0.26.0. |
| 1030 | if (!update.has_uuid() || update.uuid() == "") { |
| 1031 | status.clear_uuid(); |
| 1032 | } else if (from == UPID() || pid == UPID()) { |
| 1033 | status.clear_uuid(); |
| 1034 | } else { |