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

Method limited

src/slave/containerizer/mesos/containerizer.cpp:3260–3298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3258
3259
3260void MesosContainerizerProcess::limited(
3261 const ContainerID& containerId,
3262 const Future<ContainerLimitation>& future)
3263{
3264 if (!containers_.contains(containerId) ||
3265 containers_.at(containerId)->state == DESTROYING) {
3266 return;
3267 }
3268
3269 Option<ContainerTermination> termination = None();
3270
3271 if (future.isReady()) {
3272 LOG_BASED_ON_CLASS(containers_.at(containerId)->containerClass())
3273 << "Container " << containerId << " has reached its limit for resource "
3274 << future->resources() << " and will be terminated";
3275
3276 termination = ContainerTermination();
3277 termination->set_state(TaskState::TASK_FAILED);
3278 termination->set_message(future->message());
3279
3280 if (future->has_reason()) {
3281 termination->set_reason(future->reason());
3282 }
3283
3284 if (!future->resources().empty()) {
3285 termination->mutable_limited_resources()->CopyFrom(
3286 future->resources());
3287 }
3288 } else {
3289 // TODO(idownes): A discarded future will not be an error when
3290 // isolators discard their promises after cleanup.
3291 LOG(ERROR) << "Error in a resource limitation for container "
3292 << containerId << ": " << (future.isFailed() ? future.failure()
3293 : "discarded");
3294 }
3295
3296 // The container has been affected by the limitation so destroy it.
3297 destroy(containerId, termination);
3298}
3299
3300
3301Future<hashset<ContainerID>> MesosContainerizerProcess::containers()

Callers

nothing calls this directly

Calls 12

NoneClass · 0.85
destroyFunction · 0.85
atMethod · 0.80
isReadyMethod · 0.80
containerClassMethod · 0.80
CopyFromMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
containsMethod · 0.45
resourcesMethod · 0.45
messageMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected