void getTextNDBStopForced(QQQQ) { BaseString action_str(""); BaseString reason_str(""); BaseString sphase_str(""); int signum = theData[2]; int error = theData[3]; int sphase = theData[4]; int extra = theData[5]; getRestartAction(theData[1],action_str); if (signum) reason_str.appfmt(" Initiated by signal %d.", signum); if (error) { ndbd_exit_classification cl; ndbd_exit_status st; const char *msg = ndbd_exit_message(error, &cl); const char *cl_msg = ndbd_exit_classification_message(cl, &st); const char *st_msg = ndbd_exit_status_message(st); reason_str.appfmt(" Caused by error %d: \'%s(%s). %s\'.", error, msg, cl_msg, st_msg); if (extra != 0) reason_str.appfmt(" (extra info %d)", extra); } if (sphase < 255) sphase_str.appfmt(" Occured during startphase %u.", sphase); BaseString::snprintf(m_text, m_text_len, "Forced node shutdown completed%s.%s%s", action_str.c_str(), sphase_str.c_str(), reason_str.c_str()); }
svn_error_t * svn_cl__get_human_readable_tree_conflict_description( const char **desc, const svn_wc_conflict_description2_t *conflict, apr_pool_t *pool) { const char *action, *reason, *operation; reason = reason_str(conflict); action = action_str(conflict); operation = svn_cl__operation_str_human_readable(conflict->operation, pool); SVN_ERR_ASSERT(action && reason); *desc = apr_psprintf(pool, _("local %s, incoming %s upon %s"), reason, action, operation); return SVN_NO_ERROR; }
// Figure out which of the results the host currently has // should be aborted outright, or aborted if not started yet // int send_result_abort() { int aborts_sent = 0; int retval = 0; DB_IN_PROGRESS_RESULT result; std::string result_names; unsigned int i; if (g_request->other_results.size() == 0) { return 0; } // build list of result names // for (i=0; i<g_request->other_results.size(); i++) { OTHER_RESULT& orp=g_request->other_results[i]; orp.abort = true; // if the host has a result not in the DB, abort it orp.abort_if_not_started = false; orp.reason = ABORT_REASON_NOT_FOUND; if (i > 0) result_names.append(", "); result_names.append("'"); char buf[1024]; safe_strcpy(buf, orp.name); escape_string(buf, sizeof(buf)); result_names.append(buf); result_names.append("'"); } // look up selected fields from the results and their WUs, // and decide if they should be aborted // while (!(retval = result.enumerate(g_reply->host.id, result_names.c_str()))) { for (i=0; i<g_request->other_results.size(); i++) { OTHER_RESULT& orp = g_request->other_results[i]; if (!strcmp(orp.name, result.result_name)) { if (result.error_mask&WU_ERROR_CANCELLED ) { // if the WU has been canceled, abort the result // orp.abort = true; orp.abort_if_not_started = false; orp.reason = ABORT_REASON_WU_CANCELLED; } else if (result.assimilate_state == ASSIMILATE_DONE) { // if the WU has been assimilated, abort if not started // orp.abort = false; orp.abort_if_not_started = true; orp.reason = ABORT_REASON_ASSIMILATED; } else if (result.server_state == RESULT_SERVER_STATE_OVER && result.outcome == RESULT_OUTCOME_NO_REPLY ) { // if timed out, abort if not started // orp.abort = false; orp.abort_if_not_started = true; orp.reason = ABORT_REASON_TIMED_OUT; } else { // all is good with the result - let it process orp.abort = false; orp.abort_if_not_started = false; } break; } } } // If enumeration returned an error, don't send any aborts // if (retval && (retval != ERR_DB_NOT_FOUND)) { return retval; } // loop through the results and send the appropriate message (if any) // for (i=0; i<g_request->other_results.size(); i++) { OTHER_RESULT& orp = g_request->other_results[i]; if (orp.abort) { g_reply->result_aborts.push_back(orp.name); log_messages.printf(MSG_NORMAL, "[HOST#%d]: Send result_abort for result %s; reason: %s\n", g_reply->host.id, orp.name, reason_str(orp.reason) ); // send user message char buf[256]; sprintf(buf, "Result %s is no longer usable", orp.name); g_reply->insert_message(buf, "low"); } else if (orp.abort_if_not_started) { g_reply->result_abort_if_not_starteds.push_back(orp.name); log_messages.printf(MSG_NORMAL, "[HOST#%d]: Send result_abort_if_unstarted for result %s; reason %d\n", g_reply->host.id, orp.name, orp.reason ); } } return aborts_sent; }