When GED backend is restarted Exposure stops working

Bug #1472139 reported by Daniele Viganò
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Platform
Fix Committed
High
Paolo Tormene

Bug Description

When for some reason the GED DB server is not available or it is restarted (PostgreSQL restart, network issues) thus the connections are closed on the PostgreSQL side the Exposure application stops working until the whole platform is restarted.
This happens also if the platform server is started before the GED DB is up and running.

The GED API should trap the exception and it should try to re-establish the connection to the GED server. If it's unable to re-establish the connection a clear error should be reported (at least in the logs).

Tags: bug db exposure ged
Revision history for this message
Daniele Viganò (daniele-vigano) wrote :

The error is:
Internal Server Error: /exposure/get_all_studies
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/decorators/http.py", line 147, in inner
    response = func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openquakeplatform/utils.py", line 21, in wrapped
    return func(request)
  File "/usr/local/lib/python2.7/dist-packages/openquakeplatform/utils.py", line 66, in wrapped
    return func(request)
  File "/usr/local/lib/python2.7/dist-packages/openquakeplatform/exposure/views.py", line 445, in get_all_studies
    for sr in map(StudyRecord._make, util._get_all_studies()):
  File "/usr/local/lib/python2.7/dist-packages/openquakeplatform/exposure/util.py", line 98, in _get_all_studies
    cursor.execute(query)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 58, in execute
    six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 54, in execute
    return self.cursor.execute(query, args)
DatabaseError: SSL connection has been closed unexpectedly

description: updated
description: updated
Revision history for this message
Daniele Viganò (daniele-vigano) wrote :
Changed in oq-platform:
status: New → In Progress
Revision history for this message
Daniele Viganò (daniele-vigano) wrote :
Changed in oq-platform:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.