| 1798 | |
| 1799 | |
| 1800 | void Slave::reregistered( |
| 1801 | const UPID& from, |
| 1802 | const SlaveID& slaveId, |
| 1803 | const vector<ReconcileTasksMessage>& reconciliations, |
| 1804 | const MasterSlaveConnection& connection) |
| 1805 | { |
| 1806 | if (master != from) { |
| 1807 | LOG(WARNING) << "Ignoring re-registration message from " << from |
| 1808 | << " because it is not the expected master: " |
| 1809 | << (master.isSome() ? stringify(master.get()) : "None"); |
| 1810 | return; |
| 1811 | } |
| 1812 | |
| 1813 | CHECK_SOME(master); |
| 1814 | |
| 1815 | if (info.id() != slaveId) { |
| 1816 | EXIT(EXIT_FAILURE) |
| 1817 | << "Re-registered but got wrong id: " << slaveId |
| 1818 | << " (expected: " << info.id() << "). Committing suicide"; |
| 1819 | } |
| 1820 | |
| 1821 | if (connection.has_total_ping_timeout_seconds()) { |
| 1822 | masterPingTimeout = |
| 1823 | Seconds(static_cast<int64_t>(connection.total_ping_timeout_seconds())); |
| 1824 | } else { |
| 1825 | masterPingTimeout = DEFAULT_MASTER_PING_TIMEOUT(); |
| 1826 | } |
| 1827 | |
| 1828 | switch (state) { |
| 1829 | case DISCONNECTED: |
| 1830 | LOG(INFO) << "Re-registered with master " << master.get(); |
| 1831 | state = RUNNING; |
| 1832 | taskStatusUpdateManager->resume(); // Resume status updates. |
| 1833 | operationStatusUpdateManager.resume(); |
| 1834 | |
| 1835 | // We start the local resource providers daemon once the agent is |
| 1836 | // running, so the resource providers can use the agent API. |
| 1837 | localResourceProviderDaemon->start(info.id()); |
| 1838 | |
| 1839 | if (csiServer.get()) { |
| 1840 | csiServer->start(info.id()) |
| 1841 | .onFailed([=](const string& failure) { |
| 1842 | EXIT(EXIT_FAILURE) |
| 1843 | << "CSI server initialization failed: " << failure; |
| 1844 | }); |
| 1845 | } |
| 1846 | |
| 1847 | // Setup a timer so that the agent attempts to reregister if it |
| 1848 | // doesn't receive a ping from the master for an extended period |
| 1849 | // of time. This needs to be done once reregistered, in case we |
| 1850 | // never receive an initial ping. |
| 1851 | Clock::cancel(pingTimer); |
| 1852 | |
| 1853 | pingTimer = delay( |
| 1854 | masterPingTimeout, |
| 1855 | self(), |
| 1856 | &Slave::pingTimeout, |
| 1857 | detection); |
nothing calls this directly
no test coverage detected