| 3362 | |
| 3363 | |
| 3364 | void Master::deactivateFramework( |
| 3365 | const UPID& from, |
| 3366 | const FrameworkID& frameworkId) |
| 3367 | { |
| 3368 | ++metrics->messages_deactivate_framework; |
| 3369 | |
| 3370 | Framework* framework = getFramework(frameworkId); |
| 3371 | |
| 3372 | if (framework == nullptr) { |
| 3373 | LOG(WARNING) |
| 3374 | << "Ignoring deactivate framework message for framework " << frameworkId |
| 3375 | << " because the framework cannot be found"; |
| 3376 | |
| 3377 | return; |
| 3378 | } |
| 3379 | |
| 3380 | if (framework->pid() != from) { |
| 3381 | LOG(WARNING) |
| 3382 | << "Ignoring deactivate framework message for framework " << *framework |
| 3383 | << " because it is not expected from " << from; |
| 3384 | |
| 3385 | return; |
| 3386 | } |
| 3387 | |
| 3388 | if (!framework->connected()) { |
| 3389 | LOG(INFO) |
| 3390 | << "Ignoring deactivate framework message for framework" << *framework |
| 3391 | << " because it is disconnected"; |
| 3392 | |
| 3393 | return; |
| 3394 | } |
| 3395 | |
| 3396 | if (framework->active()) { |
| 3397 | deactivate(framework, true); |
| 3398 | } |
| 3399 | } |
| 3400 | |
| 3401 | |
| 3402 | void Master::disconnect(Framework* framework) |