MCPcopy Create free account
hub / github.com/apache/mesos / markOperationAsOrphan

Method markOperationAsOrphan

src/master/master.cpp:12795–12837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12793
12794
12795void Slave::markOperationAsOrphan(Operation* operation)
12796{
12797 // Only non-speculative operations can be orphaned.
12798 if (protobuf::isSpeculativeOperation(operation->info())) {
12799 return;
12800 }
12801
12802 LOG(INFO) << "Marking operation " << operation->uuid()
12803 << (operation->info().has_id()
12804 ? " (ID: " + operation->info().id().value() + ")"
12805 : "")
12806 << (operation->has_slave_id()
12807 ? " (Agent: " + operation->slave_id().value() + ")"
12808 : "")
12809 << (operation->has_framework_id()
12810 ? " (Framework: " + operation->framework_id().value() + ")"
12811 : "")
12812 << " in state " << operation->latest_status().state()
12813 << " as an orphan";
12814
12815 orphanedOperations.insert(operation->uuid());
12816
12817 // Only non-terminal orphans require additional resource math.
12818 if (protobuf::isTerminalState(operation->latest_status().state())) {
12819 return;
12820 }
12821
12822 // Orphaned operations have no framework, and hence cannot be accounted
12823 // for within the allocator. Instead, the operation's resources are removed
12824 // from the agent's total resources until the operation terminates.
12825 recoverResources(operation);
12826
12827 Try<Resources> consumed = protobuf::getConsumedResources(operation->info());
12828 CHECK_SOME(consumed);
12829
12830 Resources consumedUnallocated = consumed.get();
12831 consumedUnallocated.unallocate();
12832
12833 CHECK(totalResources.contains(consumedUnallocated))
12834 << "Unknown resources from orphan operation: " << consumedUnallocated;
12835
12836 totalResources -= consumedUnallocated;
12837}
12838
12839
12840Operation* Slave::getOperation(const UUID& uuid) const

Callers 2

removeFrameworkMethod · 0.80
addOperationMethod · 0.80

Calls 11

isSpeculativeOperationFunction · 0.85
isTerminalStateFunction · 0.85
getConsumedResourcesFunction · 0.85
infoMethod · 0.80
insertMethod · 0.80
valueMethod · 0.45
idMethod · 0.45
stateMethod · 0.45
getMethod · 0.45
unallocateMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected