Exemplo n.º 1
0
def create_pipeline(pipeline,status,e,conn):
    try:
        sppostprocessing.add_ppprun(pipeline,status,e.project,e.model,e.dataset_pattern,e.variable,conn)
        e.status=spconst.EVENT_STATUS_OLD # mark events as done
    except PipelineRunningException, ex: # keep exception instance name as 'ex' not to collide with 'e' event name
        splog.warning('SPEVENTT-012',"Event status set to anomaly")
        e.status=spconst.EVENT_STATUS_ANOMALY # mark events as anomaly (this event has been inhibited and may need to be manually switched to 'new'. also most often it's not necessary (i.e. it has been inhibited because another identical event was preceding it))
Exemplo n.º 2
0
def create_pipeline(pipeline, status, e, conn):
    try:
        sppostprocessing.add_ppprun(pipeline, status, e.project, e.model,
                                    e.dataset_pattern, e.variable, conn)
        e.status = spconst.EVENT_STATUS_OLD  # mark events as done
    except PipelineRunningException, ex:  # keep exception instance name as 'ex' not to collide with 'e' event name
        splog.warning('SPEVENTT-012', "Event status set to anomaly")
        e.status = spconst.EVENT_STATUS_ANOMALY  # mark events as anomaly (this event has been inhibited and may need to be manually switched to 'new'. also most often it's not necessary (i.e. it has been inhibited because another identical event was preceding it))
Exemplo n.º 3
0
 def _reconnect(self, fn, *args, **kwargs):
     if not self.__reconnection_wrapper_in_effect:
         warning_printed = False
         while True:
             try:
                 self.__reconnection_wrapper_in_effect = True
                 ret = fn(self, *args, **kwargs)
                 self.__reconnection_wrapper_in_effect = False
                 return ret
             except (pymongo.errors.AutoReconnect, socket.error) as e:
                 # Retry procedure.
                 # Do not disconnect, as this will cause Mongo to forget that it
                 # had checked the problematic host and re-check it, putting us
                 # into a loop that will only end when the host comes back online.
                 if not warning_printed:
                     splog.warning('Error communicating with Mongo, retrying')
                     for line in traceback.format_exc(e).splitlines():
                         splog.warning(line)
                     warning_printed = True
                 time.sleep(MONGO_DOWN_NICE)
     else:
         return fn(self, *args, **kwargs)
Exemplo n.º 4
0
#!/usr/bin/env python

KWARGS = {'host':'log.alcfd.com', 'tag':'splog_example4'}

import splog
splog.configure(name='example4', **KWARGS)
splog.warning('Foo Bar')