| 671 | |
| 672 | |
| 673 | void CheckerProcess::_nestedCommandCheck( |
| 674 | shared_ptr<Promise<int>> promise, |
| 675 | check::Command cmd, |
| 676 | runtime::Nested nested) |
| 677 | { |
| 678 | // TODO(alexr): Use lambda named captures for |
| 679 | // these cached values once they are available. |
| 680 | const TaskID _taskId = taskId; |
| 681 | const string _name = name; |
| 682 | |
| 683 | http::connect(nested.agentURL) |
| 684 | .onFailed(defer(self(), [_taskId, _name, promise](const string& failure) { |
| 685 | LOG(WARNING) << "Unable to establish connection with the agent to launch " |
| 686 | << _name << " for task '" << _taskId << "'" |
| 687 | << ": " << failure; |
| 688 | |
| 689 | // We treat this as a transient failure. |
| 690 | promise->discard(); |
| 691 | })) |
| 692 | .onReady(defer(self(), |
| 693 | &Self::__nestedCommandCheck, |
| 694 | promise, |
| 695 | lambda::_1, |
| 696 | cmd, |
| 697 | nested)); |
| 698 | } |
| 699 | |
| 700 | |
| 701 | void CheckerProcess::__nestedCommandCheck( |