Skip to content
Snippets Groups Projects
Commit 186c068a authored by Andrea Michelotti's avatar Andrea Michelotti
Browse files

bug on command error fixed, but better solution must be found

parent 302271a9
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ option(CHAOS_WAN "Chaos Wan Service" ON)
option(CHAOS_DATA_EXPORT "Chaos Data Export" ON)
option(CHAOS_EXAMPLES "Chaos Examples" ON)
option(CHAOS_CCS "Chaos CCS Compile needs qt5.6-static-x86_64 installed" OFF)
set(QMAKE_PATH "Default QT QMAKE PATH" CACHE STRING "/usr/local/chaos/qt-install/5.6/gcc_64/bin")
EXECUTE_PROCESS(
COMMAND ./version.sh
......@@ -140,9 +140,10 @@ ENDIF()
ENDIF()
IF(CHAOS_CCS)
MESG("CCS compilation ENABLED")
IF(EXISTS "/usr/local/chaos/qt5.6-static-x86_64/bin/qmake")
IF(EXISTS "${QMAKE_PATH}/qmake")
MESG("Found 'qmake' in ${QMAKE_PATH}")
execute_process(
COMMAND /usr/local/chaos/qt5.6-static-x86_64/bin/qmake
COMMAND ${QMAKE_PATH}/qmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ccs
RESULT_VARIABLE err
OUTPUT_VARIABLE out
......@@ -160,11 +161,13 @@ ENDIF()
if( err)
ERROR("error compiling: ${out}")
endif()
FILE(GLOB exe ccs/ccs ccs/ccs.sh)
FILE(COPY ${exe} DESTINATION bin/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ELSE()
ERROR("missing /usr/local/chaos/qt5.6-static-x86_64/bin/qmake")
ENDIF()
ENDIF()
IF (EXISTS ccs/ccs)
FILE(GLOB exe ccs/ccs ccs/ccs.sh)
FILE(COPY ${exe} DESTINATION bin/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF()
#add test
......@@ -479,7 +479,7 @@ void BatchCommandSandbox::checkNextCommand() {
if (event_handler) event_handler->handleCommandEvent(command_to_delete->element->cmdImpl->command_alias,
command_to_delete->element->cmdImpl->unique_id,
BatchCommandEventType::EVT_FAULT,
static_cast<FaultDescription*> (&command_to_delete->element->cmdImpl->fault_description),
dynamic_cast<FaultDescription*> (&command_to_delete->element->cmdImpl->fault_description),
sizeof (FaultDescription));
break;
......
......@@ -201,14 +201,21 @@ void SlowCommandExecutor::handleCommandEvent(const std::string& command_alias,
case BatchCommandEventType::EVT_FAULT: {
CDataWrapper *command_and_fault = static_cast<CDataWrapper*>(type_value_ptr);
if(command_and_fault &&
command_and_fault->hasKey(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_CODE) &&
// CDataWrapper *command_and_fault = static_cast<CDataWrapper*>((CDataWrapper*)type_value_ptr);
FaultDescription *command_and_fault = static_cast<FaultDescription*>((FaultDescription*)type_value_ptr);
if(command_and_fault /*&&
command_and_fault->hasKey(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_CODE) &&
command_and_fault->hasKey(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_MESSAGE) &&
command_and_fault->hasKey(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_DOMAIN)) {
const int32_t code = command_and_fault->getInt32Value(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_CODE);
command_and_fault->hasKey(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_DOMAIN)*/
) {
/* const int32_t code = command_and_fault->getInt32Value(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_CODE);
const std::string message = command_and_fault->getStringValue(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_MESSAGE);
const std::string domain = command_and_fault->getStringValue(MetadataServerLoggingDefinitionKeyRPC::ErrorLogging::PARAM_NODE_LOGGING_LOG_ERROR_DOMAIN);
*/
const int32_t code=command_and_fault->code;
const std::string message = command_and_fault->description;
const std::string domain = command_and_fault->domain;
//log error on metadata server
error_logging_channel->logError(control_unit_instance->getCUID(),
command_alias,
......@@ -218,6 +225,7 @@ void SlowCommandExecutor::handleCommandEvent(const std::string& command_alias,
CException ex(code, message, domain);
//async go into recoverable error
boost::thread(boost::bind(&AbstractControlUnit::_goInRecoverableError, control_unit_instance, ex)).detach();
command_data=NULL;
} else {
SCELERR_ << "Command id " << command_seq << " gone in fault without exception";
}
......
......@@ -3,4 +3,4 @@ log-level=debug
log-file=cu.log
log-on-file=yes
event-disable=1
publishing-interface=lo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment