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:


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


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
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1356, in run
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1342, in loop
File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1136, in process_events
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
File "/home/joseph/archivematica/src/MCPServer/lib/MCPlogging.py", line 59, in logJobCreated
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
OperationalError: (2006, 'MySQL server has gone away')

[g] Legacy categories: MCP


#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