Created
May 18, 2018 00:39
-
-
Save sagar8192/0b9dbccc908818f8f9f5a18d1f634513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/master/master.cpp b/src/master/master.cpp | |
index cc2685a6b..e6548dd8f 100644 | |
--- a/src/master/master.cpp | |
+++ b/src/master/master.cpp | |
@@ -8660,6 +8660,13 @@ void Master::offer( | |
resources.at(role)) { | |
Slave* slave = slaves.registered.get(slaveId); | |
+ // Do not send the offer from the slave, if it marked for | |
+ // maintenance. | |
+ CHECK(machines.contains(slave->machineId)); | |
+ if (machines[slave->machineId].info.has_unavailability()) { | |
+ continue; | |
+ } | |
+ | |
if (slave == nullptr) { | |
LOG(WARNING) | |
<< "Master returning resources offered to framework " << *framework | |
@@ -8739,14 +8746,6 @@ void Master::offer( | |
} | |
} | |
- // If the slave in this offer is planned to be unavailable due to | |
- // maintenance in the future, then set the Unavailability. | |
- CHECK(machines.contains(slave->machineId)); | |
- if (machines[slave->machineId].info.has_unavailability()) { | |
- offer->mutable_unavailability()->CopyFrom( | |
- machines[slave->machineId].info.unavailability()); | |
- } | |
- | |
offers[offer->id()] = offer; | |
framework->addOffer(offer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment