![]() |
![]() |
#include <SharedResources.h>
Public Member Functions | |
void | localDebug (const std::string &message) const |
void | moveToFailedState (xcept::Exception &) |
Public Attributes | |
CommandQueuePtr | commandQueue_ |
boost::shared_ptr< Configuration > | configuration_ |
boost::shared_ptr< DiscardManager > | discardManager_ |
boost::shared_ptr < DiskWriterResources > | diskWriterResources_ |
boost::shared_ptr < DQMEventProcessorResources > | dqmEventProcessorResources_ |
DQMEventQueuePtr | dqmEventQueue_ |
DQMEventQueueCollectionPtr | dqmEventQueueCollection_ |
EventQueueCollectionPtr | eventQueueCollection_ |
FragmentQueuePtr | fragmentQueue_ |
boost::shared_ptr < InitMsgCollection > | initMsgCollection_ |
boost::shared_ptr < RegistrationCollection > | registrationCollection_ |
RegistrationQueuePtr | registrationQueue_ |
boost::shared_ptr < StatisticsReporter > | statisticsReporter_ |
StreamQueuePtr | streamQueue_ |
Container for shared resources.
Definition at line 40 of file SharedResources.h.
void stor::SharedResources::localDebug | ( | const std::string & | message | ) | const |
Write message to a file in /tmp (last resort when everything else fails)
Definition at line 67 of file SharedResources.cc.
References configuration_, f, alignmentValidation::fname, and dbtoconf::out.
Referenced by moveToFailedState().
{ std::ostringstream fname_oss; fname_oss << "/tmp/storage_manager_debug_" << configuration_->getDiskWritingParams().smInstanceString_ << "_" << getpid(); const std::string fname = fname_oss.str(); std::ofstream f( fname.c_str(), std::ios_base::ate | std::ios_base::out | std::ios_base::app ); if( f.is_open() ) { try { f << message << std::endl; f.close(); } catch(...) {} } }
void stor::SharedResources::moveToFailedState | ( | xcept::Exception & | exception | ) |
Add a Failed state-machine event to the command queue
Definition at line 28 of file SharedResources.cc.
References commandQueue_, ExpressReco_HICollisions_FallBack::e, exception, Exception, Fail, stor::AlarmHandler::FATAL, localDebug(), seconds(), and statisticsReporter_.
{ std::string errorMsg = "Failed to process FAIL exception: " + xcept::stdformat_exception_history(exception) + " due to "; try { statisticsReporter_->alarmHandler()->notifySentinel(AlarmHandler::FATAL, exception); statisticsReporter_->getStateMachineMonitorCollection().setStatusMessage( xcept::stdformat_exception_history(exception) ); EventPtr_t stMachEvent( new Fail() ); // wait maximum 5 seconds until enqueuing succeeds if ( ! commandQueue_->enqTimedWait( stMachEvent, boost::posix_time::seconds(5) ) ) { XCEPT_DECLARE_NESTED( stor::exception::StateTransition, sentinelException, "Failed to enqueue FAIL event", exception ); statisticsReporter_->alarmHandler()-> notifySentinel(AlarmHandler::FATAL, sentinelException); } } catch(xcept::Exception &e) { errorMsg += xcept::stdformat_exception_history(e); localDebug( errorMsg ); } catch(std::exception &e) { errorMsg += e.what(); localDebug( errorMsg ); } catch( ... ) { errorMsg += "an unknown exception."; localDebug( errorMsg ); } }
Definition at line 44 of file SharedResources.h.
Referenced by moveToFailedState().
boost::shared_ptr<Configuration> stor::SharedResources::configuration_ |
Definition at line 53 of file SharedResources.h.
Referenced by localDebug().
boost::shared_ptr<DiscardManager> stor::SharedResources::discardManager_ |
Definition at line 54 of file SharedResources.h.
boost::shared_ptr<DiskWriterResources> stor::SharedResources::diskWriterResources_ |
Definition at line 55 of file SharedResources.h.
boost::shared_ptr<DQMEventProcessorResources> stor::SharedResources::dqmEventProcessorResources_ |
Definition at line 56 of file SharedResources.h.
Definition at line 45 of file SharedResources.h.
Definition at line 50 of file SharedResources.h.
Definition at line 49 of file SharedResources.h.
Definition at line 46 of file SharedResources.h.
boost::shared_ptr<InitMsgCollection> stor::SharedResources::initMsgCollection_ |
Definition at line 57 of file SharedResources.h.
boost::shared_ptr<RegistrationCollection> stor::SharedResources::registrationCollection_ |
Definition at line 59 of file SharedResources.h.
Definition at line 48 of file SharedResources.h.
boost::shared_ptr<StatisticsReporter> stor::SharedResources::statisticsReporter_ |
Definition at line 58 of file SharedResources.h.
Referenced by moveToFailedState().
Definition at line 47 of file SharedResources.h.