Opened 8 years ago

Closed 8 years ago

#171 closed defect (fixed)

jobarchived crashed after 20 interation XML parsing due to exception

Reported by: oufei.zhao@… Owned by: ramonb
Priority: normal Milestone: 1.1.1
Component: jobarchived Version: 1.1
Keywords: Cc:
Estimated Number of Hours:

Description

In line 914 of jobarchived.py, Null checking on timeout_jobs should be added before accessing it. It will throw exception when timeout_jobs is 'None'. Once add a line to check null, it works fine.

if timedout_jobs != None: <== added

for j in timedout_jobs:

del self.jobAttrs[ j ] del self.jobAttrsSaved[ j ]

See below for log and stack trace: Mon 24 Jun 2013 18:00:59 - job_xml_thread(): Retrieving XML data.. Mon 24 Jun 2013 18:00:59 - job_xml_thread(): Done retrieving: data size 2656 Mon 24 Jun 2013 18:00:59 - job_xml_thread(): Parsing XML.. Mon 24 Jun 2013 18:00:59 - XML: Start document: iteration 20 Mon 24 Jun 2013 18:00:59 - XML: Processed 2 elements - found 0 jobs Mon 24 Jun 2013 18:00:59 - self.heartbeat = 0 Mon 24 Jun 2013 18:00:59 - job_xml_thread(): Done parsing. Mon 24 Jun 2013 18:00:59 - job_xml_thread(): Sleeping.. (15s) Mon 24 Jun 2013 18:01:04 - job_xml_thread(): Retrieving XML data.. Mon 24 Jun 2013 18:01:04 - job_xml_thread(): Done retrieving: data size 2656 Mon 24 Jun 2013 18:01:04 - job_xml_thread(): Parsing XML.. Mon 24 Jun 2013 18:01:04 - Housekeeping: checking database for timed out jobs.. Mon 24 Jun 2013 18:01:04 - doDatabase(): get: SELECT * from jobs WHERE job_status != 'F' Mon 24 Jun 2013 18:01:04 - doDatabase(): result: [] Exception in thread job_proc_thread: Traceback (most recent call last):

File "/usr/local/lib/python2.4/threading.py", line 442, in bootstrap

self.run()

File "/usr/local/lib/python2.4/threading.py", line 422, in run

self.target(*self.args, self.kwargs)

File "/usr/sbin/jobarchived", line 870, in run

xml.sax.parseString( my_data, self.myXMLHandler, self.myXMLError )

File "/usr/local/lib/python2.4/xml/sax/init.py", line 49, in parseString

parser.parse(inpsrc)

File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 107, in parse

xmlreader.IncrementalParser?.parse(self, source)

File "/usr/local/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse

self.feed(buffer)

File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 200, in feed

self._cont_handler.startDocument()

File "/usr/sbin/jobarchived", line 914, in startDocument

for j in timedout_jobs:

TypeError?: iteration over non-sequence

Change History (2)

comment:1 Changed 8 years ago by ramonb

  • Component changed from general to jobarchived
  • Owner changed from somebody to ramonb
  • Status changed from new to assigned

Thank you for reporting this. I will add your patch

comment:2 Changed 8 years ago by ramonb

  • Resolution set to fixed
  • Status changed from assigned to closed

In 925:

jobarchived/jobarchived.py:

  • applied fix to exception that occurs when no timeout jobs are found during housekeeping
  • closes #171
Note: See TracTickets for help on using tickets.