def convert_raw_crash_to_processed_crash(self, raw_crash, raw_dump): """ This function is run only by a worker thread. Given a job, fetch a thread local database connection and the json document. Use these to create the record in the 'reports' table, then start the analysis of the dump file. input parameters: """ try: self.quit_check() crash_id = raw_crash.uuid processor_notes = [] processed_crash = DotDict() processed_crash.uuid = raw_crash.uuid processed_crash.success = False started_timestamp = self._log_job_start(crash_id) #self.config.logger.debug('about to apply rules') self.raw_crash_transform_rule_system.apply_all_rules(raw_crash, self) #self.config.logger.debug('done applying transform rules') try: submitted_timestamp = datetimeFromISOdateString( raw_crash.submitted_timestamp ) except KeyError: submitted_timestamp = dateFromOoid(crash_id) # formerly the call to 'insertReportIntoDatabase' processed_crash_update = self._create_basic_processed_crash( crash_id, raw_crash, submitted_timestamp, started_timestamp, processor_notes ) processed_crash.update(processed_crash_update) temp_dump_pathname = self._get_temp_dump_pathname( crash_id, raw_dump ) try: #logger.debug('about to doBreakpadStackDumpAnalysis') processed_crash_update_dict = \ self._do_breakpad_stack_dump_analysis( crash_id, temp_dump_pathname, processed_crash.hang_type, processed_crash.java_stack_trace, submitted_timestamp, processor_notes ) processed_crash.update(processed_crash_update_dict) finally: self._cleanup_temp_file(temp_dump_pathname) processed_crash.topmost_filenames = "|".join( processed_crash.get('topmost_filenames', []) ) try: processed_crash.Winsock_LSP = raw_crash.Winsock_LSP except KeyError: pass # if it's not in the original raw_crash, # it does get into the jsonz #except (KeyboardInterrupt, SystemExit): #self.config.logger.info("quit request detected") #raise except Exception, x: self.config.logger.warning( 'Error while processing %s: %s', crash_id, str(x), exc_info=True ) processor_notes.append(str(x))
def convert_raw_crash_to_processed_crash(self, raw_crash, raw_dump): """ This function is run only by a worker thread. Given a job, fetch a thread local database connection and the json document. Use these to create the record in the 'reports' table, then start the analysis of the dump file. input parameters: """ try: self.quit_check() crash_id = raw_crash.uuid processor_notes = [] processed_crash = DotDict() processed_crash.uuid = raw_crash.uuid processed_crash.success = False started_timestamp = self._log_job_start(crash_id) #self.config.logger.debug('about to apply rules') self.raw_crash_transform_rule_system.apply_all_rules( raw_crash, self) #self.config.logger.debug('done applying transform rules') try: submitted_timestamp = datetimeFromISOdateString( raw_crash.submitted_timestamp) except KeyError: submitted_timestamp = dateFromOoid(crash_id) # formerly the call to 'insertReportIntoDatabase' processed_crash_update = self._create_basic_processed_crash( crash_id, raw_crash, submitted_timestamp, started_timestamp, processor_notes) processed_crash.update(processed_crash_update) temp_dump_pathname = self._get_temp_dump_pathname( crash_id, raw_dump) try: #logger.debug('about to doBreakpadStackDumpAnalysis') processed_crash_update_dict = \ self._do_breakpad_stack_dump_analysis( crash_id, temp_dump_pathname, processed_crash.hang_type, processed_crash.java_stack_trace, submitted_timestamp, processor_notes ) processed_crash.update(processed_crash_update_dict) finally: self._cleanup_temp_file(temp_dump_pathname) processed_crash.topmost_filenames = "|".join( processed_crash.get('topmost_filenames', [])) try: processed_crash.Winsock_LSP = raw_crash.Winsock_LSP except KeyError: pass # if it's not in the original raw_crash, # it does get into the jsonz #except (KeyboardInterrupt, SystemExit): #self.config.logger.info("quit request detected") #raise except Exception, x: self.config.logger.warning('Error while processing %s: %s', crash_id, str(x), exc_info=True) processor_notes.append(str(x))