| 385 | } |
| 386 | |
| 387 | void statusUpdateAcknowledgement( |
| 388 | const SlaveID& slaveId, |
| 389 | const FrameworkID& frameworkId, |
| 390 | const TaskID& taskId, |
| 391 | const string& uuid) |
| 392 | { |
| 393 | Try<id::UUID> uuid_ = id::UUID::fromBytes(uuid); |
| 394 | CHECK_SOME(uuid_); |
| 395 | |
| 396 | if (aborted.load()) { |
| 397 | VLOG(1) << "Ignoring status update acknowledgement " |
| 398 | << uuid_.get() << " for task " << taskId |
| 399 | << " of framework " << frameworkId |
| 400 | << " because the driver is aborted!"; |
| 401 | return; |
| 402 | } |
| 403 | |
| 404 | if (!connected) { |
| 405 | LOG(WARNING) << "Ignoring status update acknowledgement " |
| 406 | << uuid_.get() << " for task " << taskId |
| 407 | << " of framework " << frameworkId |
| 408 | << " because the driver is disconnected!"; |
| 409 | return; |
| 410 | } |
| 411 | |
| 412 | if (!updates.contains(uuid_.get())) { |
| 413 | LOG(WARNING) << "Ignoring unknown status update acknowledgement " |
| 414 | << uuid_.get() << " for task " << taskId |
| 415 | << " of framework " << frameworkId; |
| 416 | return; |
| 417 | } |
| 418 | |
| 419 | VLOG(1) << "Executor received status update acknowledgement " |
| 420 | << uuid_.get() << " for task " << taskId |
| 421 | << " of framework " << frameworkId; |
| 422 | |
| 423 | // If this is a terminal status update acknowledgment for the Docker |
| 424 | // executor, stop the driver to terminate the executor. |
| 425 | // |
| 426 | // TODO(abudnik): This is a workaround for MESOS-9847. A better solution |
| 427 | // is to update supported API for the Docker executor from V0 to V1. It |
| 428 | // will allow the executor to handle status update acknowledgments itself. |
| 429 | if (mesos::internal::protobuf::isTerminalState( |
| 430 | updates[uuid_.get()].status().state()) && |
| 431 | dynamic_cast<docker::DockerExecutor*>(executor)) { |
| 432 | driver->stop(); |
| 433 | } |
| 434 | |
| 435 | // Remove the corresponding update. |
| 436 | updates.erase(uuid_.get()); |
| 437 | |
| 438 | // Remove the corresponding task. |
| 439 | tasks.erase(taskId); |
| 440 | } |
| 441 | |
| 442 | void frameworkMessage( |
| 443 | const SlaveID& slaveId, |