CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
stor::SharedResources Struct Reference

#include <SharedResources.h>

Public Member Functions

void localDebug (const std::string &message) const
 
void moveToFailedState (xcept::Exception &)
 

Public Attributes

CommandQueuePtr commandQueue_
 
boost::shared_ptr< Configurationconfiguration_
 
boost::shared_ptr< DiscardManagerdiscardManager_
 
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_
 

Detailed Description

Container for shared resources.

Author:
mommsen
Revision:
1.6.12.1
Date:
2011/03/07 11:33:04

Definition at line 40 of file SharedResources.h.

Member Function Documentation

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().

68  {
69  std::ostringstream fname_oss;
70  fname_oss << "/tmp/storage_manager_debug_" <<
71  configuration_->getDiskWritingParams().smInstanceString_ <<
72  "_" << getpid();
73  const std::string fname = fname_oss.str();
74  std::ofstream f( fname.c_str(), std::ios_base::ate | std::ios_base::out | std::ios_base::app );
75  if( f.is_open() )
76  {
77  try
78  {
79  f << message << std::endl;
80  f.close();
81  }
82  catch(...)
83  {}
84  }
85  }
boost::shared_ptr< Configuration > configuration_
double f[11][100]
tuple out
Definition: dbtoconf.py:99
string message
Definition: argparse.py:126
string fname
main script
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_, cmsCodeRules.cppFunctionSkipper::exception, edm::hlt::Exception, edm::hlt::Fail, stor::AlarmHandler::FATAL, localDebug(), seconds(), and statisticsReporter_.

29  {
30  std::string errorMsg = "Failed to process FAIL exception: "
31  + xcept::stdformat_exception_history(exception) + " due to ";
32 
33  try
34  {
35  statisticsReporter_->alarmHandler()->notifySentinel(AlarmHandler::FATAL, exception);
36  statisticsReporter_->getStateMachineMonitorCollection().setStatusMessage(
37  xcept::stdformat_exception_history(exception)
38  );
39  EventPtr_t stMachEvent( new Fail() );
40  // wait maximum 5 seconds until enqueuing succeeds
41  if ( ! commandQueue_->enqTimedWait( stMachEvent, boost::posix_time::seconds(5) ) )
42  {
43  XCEPT_DECLARE_NESTED( stor::exception::StateTransition,
44  sentinelException, "Failed to enqueue FAIL event", exception );
45  statisticsReporter_->alarmHandler()->
46  notifySentinel(AlarmHandler::FATAL, sentinelException);
47  }
48  }
49  catch(xcept::Exception &e)
50  {
51  errorMsg += xcept::stdformat_exception_history(e);
52  localDebug( errorMsg );
53  }
54  catch(std::exception &e)
55  {
56  errorMsg += e.what();
57  localDebug( errorMsg );
58  }
59  catch( ... )
60  {
61  errorMsg += "an unknown exception.";
62  localDebug( errorMsg );
63  }
64  }
double seconds()
CommandQueuePtr commandQueue_
reject
Definition: HLTenums.h:23
boost::shared_ptr< boost::statechart::event_base > EventPtr_t
Definition: CommandQueue.h:21
boost::shared_ptr< StatisticsReporter > statisticsReporter_
void localDebug(const std::string &message) const

Member Data Documentation

CommandQueuePtr stor::SharedResources::commandQueue_

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.

DQMEventQueuePtr stor::SharedResources::dqmEventQueue_

Definition at line 45 of file SharedResources.h.

DQMEventQueueCollectionPtr stor::SharedResources::dqmEventQueueCollection_

Definition at line 50 of file SharedResources.h.

EventQueueCollectionPtr stor::SharedResources::eventQueueCollection_

Definition at line 49 of file SharedResources.h.

FragmentQueuePtr stor::SharedResources::fragmentQueue_

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.

RegistrationQueuePtr stor::SharedResources::registrationQueue_

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().

StreamQueuePtr stor::SharedResources::streamQueue_

Definition at line 47 of file SharedResources.h.