Esempio n. 1
0
 def put(self, item, block=True, timeout=None):
     self._lock.acquire()
     try:
         try:
             if 'message_id' in item:
                 message_id = item['message_id']
                 if message_id in self._message_id_set:
                     _g_logger.info("Skipping sending a retransmission "
                                    "of message id %s" % message_id)
                     return
                 else:
                     _g_logger.debug("Adding the message with id %s " %
                                     message_id)
                 self._message_id_set.add(message_id)
             if 'request_id' in item:
                 request_id = item['request_id']
                 if request_id not in self._request_id_count:
                     self._request_id_count[request_id] = 0
                 self._request_id_count[request_id] += 1
                 if self._request_id_count[request_id] >= self._max_req_id:
                     msg = "TOO MANY MESSAGES FOR %s!" % request_id
                     _g_logger.error(msg)
                     agent_utils.build_assertion_exception(_g_logger, msg)
                     if self._request_id_count[request_id] ==\
                             self._max_req_id:
                         dcm_logger.log_to_dcm_console_overloaded(msg=msg)
                     return
         except Exception as ex:
             _g_logger.warn("Exception checking if message is a retrans "
                            "%s" % str(ex))
         return self._q.put(item, block=block, timeout=timeout)
     finally:
         self._lock.release()
Esempio n. 2
0
 def put(self, item, block=True, timeout=None):
     self._lock.acquire()
     try:
         try:
             if 'message_id' in item:
                 message_id = item['message_id']
                 if message_id in self._message_id_set:
                     _g_logger.info("Skipping sending a retransmission "
                                    "of message id %s" % message_id)
                     return
                 else:
                     _g_logger.debug("Adding the message with id %s " %
                                     message_id)
                 self._message_id_set.add(message_id)
             if 'request_id' in item:
                 request_id = item['request_id']
                 if request_id not in self._request_id_count:
                     self._request_id_count[request_id] = 0
                 self._request_id_count[request_id] += 1
                 if self._request_id_count[request_id] >= self._max_req_id:
                     msg = "TOO MANY MESSAGES FOR %s!" % request_id
                     _g_logger.error(msg)
                     agent_utils.build_assertion_exception(_g_logger, msg)
                     if self._request_id_count[request_id] ==\
                             self._max_req_id:
                         dcm_logger.log_to_dcm_console_overloaded(msg=msg)
                     return
         except Exception as ex:
             _g_logger.warn("Exception checking if message is a retrans "
                            "%s" % str(ex))
         return self._q.put(item, block=block, timeout=timeout)
     finally:
         self._lock.release()
Esempio n. 3
0
 def test_stack_trace(self):
     utils.build_assertion_exception(logging, "a message")
Esempio n. 4
0
 def stack_trace_handler(self, signum, frame):
     utils.build_assertion_exception(self.g_logger, "signal stack")
Esempio n. 5
0
def tearDown():
    msg = agent_utils.build_assertion_exception(logging, "END OF TESTS DUMP")
    print(msg)
    with open("/tmp/stack_dump", "w") as fptr:
        fptr.write(msg)
Esempio n. 6
0
 def test_stack_trace(self):
     utils.build_assertion_exception(logging, "a message")
Esempio n. 7
0
 def stack_trace_handler(self, signum, frame):
     utils.build_assertion_exception(self.g_logger, "signal stack")