@@ -1155,23 +1155,28 @@ bool update_status(atrt_config &config, int types, bool fail_on_missing) {
1155
1155
}
1156
1156
1157
1157
int check_ndb_or_servers_failures (atrt_config &config) {
1158
- int result = 0 ;
1158
+ int failed_processes = 0 ;
1159
1159
const int types = p_ndb | p_servers;
1160
1160
for (unsigned i = 0 ; i < config.m_processes .size (); i++) {
1161
1161
atrt_process &proc = *config.m_processes [i];
1162
- if ((types & proc.m_type ) != 0 ) {
1163
- if (!(proc.m_proc .m_status == " running" ||
1164
- IF_WIN (proc.m_type & atrt_process::AP_MYSQLD, 0 ))) {
1165
- g_logger.critical (" %s #%d not running on %s" , proc.m_name .c_str (),
1166
- proc.m_index , proc.m_host ->m_hostname .c_str ());
1167
- if (p_ndb & proc.m_type )
1168
- result = ERR_NDB_FAILED;
1169
- else if (p_servers & proc.m_type )
1170
- result = ERR_SERVERS_FAILED;
1171
- }
1162
+ bool skip = IF_WIN (proc.m_type & atrt_process::AP_MYSQLD, 0 );
1163
+ bool isRunning = proc.m_proc .m_status == " running" ;
1164
+ if ((types & proc.m_type ) != 0 && !isRunning && !skip) {
1165
+ g_logger.critical (" %s #%d not running on %s" , proc.m_name .c_str (),
1166
+ proc.m_index , proc.m_host ->m_hostname .c_str ());
1167
+ failed_processes |= proc.m_type ;
1172
1168
}
1173
1169
}
1174
- return result;
1170
+ if ((failed_processes & p_ndb) && (failed_processes & p_servers)) {
1171
+ return ERR_NDB_AND_SERVERS_FAILED;
1172
+ }
1173
+ if ((failed_processes & p_ndb) != 0 ) {
1174
+ return ERR_NDB_FAILED;
1175
+ }
1176
+ if ((failed_processes & p_servers) != 0 ) {
1177
+ return ERR_SERVERS_FAILED;
1178
+ }
1179
+ return 0 ;
1175
1180
}
1176
1181
1177
1182
bool is_client_running (atrt_config &config) {
0 commit comments