Bug #1056

MCP - Database connection drops after long periods of innactivity.

Added by Joseph Perry over 10 years ago. Updated almost 9 years ago.

Status:VerifiedStart date:
Priority:MediumDue date:
Assignee:Joseph Perry% Done:

0%

Category:-
Target version:Release 0.7
Google Code Legacy ID:archivematica-401 Pull Request:
Sponsored: Requires documentation:

Description

This is the MCP error output when trying to process a SIP after two days of idleness:

Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in bootstrap_inner
self.run()
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1356, in run
self.loop()
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1342, in loop
self.process_events()
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1136, in process_events
self._default_proc_fun(revent)
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 811, in _call

return _ProcessEvent.
_call__(self, event)
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 544, in call
return meth(event)
File "/usr/lib/archivematica/MCPServer/archivematicaMCP.py", line 621, in process_IN_MOVED_TO
job = Job(self.config, os.path.join(event.path, event.name))
File "/usr/lib/archivematica/MCPServer/archivematicaMCP.py", line 401, in init
logJobCreated(self)
File "/home/joseph/archivematica/src/MCPServer/lib/MCPlogging.py", line 59, in logJobCreated
logJobCreatedSQL(job)
File "/home/joseph/archivematica/src/MCPServer/lib/MCPloggingSQL.py", line 113, in logJobCreatedSQL
separator + job.step + separator + job.createdDate + "' )" )
File "/home/joseph/archivematica/src/MCPServer/lib/MCPloggingSQL.py", line 62, in runSQL
db.query(sql)
OperationalError: (2006, 'MySQL server has gone away')

[g] Legacy categories: MCP

History

#1 Updated by Joseph Perry over 10 years ago

Possible solution is to try to catch that specific error, and attempt a reconnect to the DB, and re-issue the querie. Should also implement a frequency check, to ensure it doesn't thrash.

#2 Updated by Joseph Perry over 10 years ago

This code snipet should help:

  1. except MySQLdb.OperationalError, message:
  2. errorMessage = "Error %d:\n%s" % (message[ 0 ], message[ 1 ] )
  3. return

#3 Updated by Joseph Perry over 10 years ago

Committed r1066.
I believe this is fixed. Test period is very long to verify.

#4 Updated by Joseph Perry over 10 years ago

Tested. Still connected after more than 15 hours of idle.

#5 Updated by Joseph Perry over 10 years ago

  • Status changed from New to Verified

Considering fixed.

Also available in: Atom PDF