Logo Search packages:      
Sourcecode: condor version File versions  Download package

int DaemonCore::sendUpdates ( int  cmd,
ClassAd ad1,
ClassAd ad2 = NULL,
bool  nonblock = false 
)

Send the given ClassAd(s) to all of the collectors defined in the COLLECTOR_HOST setting. Now that DaemonCore manages this list of collectors, daemons only need to invoke this method to send out their updates.

Parameters:
cmd The update command to send (e.g. UPDATE_STARTD_AD)
ad1 The primary ClassAd to send.
ad2 The secondary ClassAd to send. Usually NULL, except in the case of startds sending the "private" ad.
nonblock Should the update use non-blocking communication.
Returns:
The number of successful updates that were sent.

Definition at line 9497 of file daemon_core.cpp.

References evalExpr(), getpid(), and Send_Signal().

Referenced by JobQueueDBManager::pollingTime().

{
      ASSERT(ad1);
      ASSERT(m_collector_list);

            // Now's our chance to evaluate the DAEMON_SHUTDOWN expressions.
      if (!m_in_daemon_shutdown_fast &&
            evalExpr(ad1, "DAEMON_SHUTDOWN_FAST", ATTR_DAEMON_SHUTDOWN_FAST,
                         "starting fast shutdown"))   {
                  // Daemon wants to quickly shut itself down and not restart.
            m_wants_restart = false;
            m_in_daemon_shutdown_fast = true;
            daemonCore->Send_Signal( daemonCore->getpid(), SIGQUIT );
      }
      else if (!m_in_daemon_shutdown &&
                   evalExpr(ad1, "DAEMON_SHUTDOWN", ATTR_DAEMON_SHUTDOWN,
                                "starting graceful shutdown")) {
            m_wants_restart = false;
            m_in_daemon_shutdown = true;
            daemonCore->Send_Signal( daemonCore->getpid(), SIGTERM );
      }

            // Even if we just decided to shut ourselves down, we should
            // still send the updates originally requested by the caller.
      return m_collector_list->sendUpdates(cmd, ad1, ad2, nonblock);
}


Generated by  Doxygen 1.6.0   Back to index