Occasionally an OperationalError is raised (usually? always? when trying to log in) claiming "server closed the connection unexpectedly", or something to that effect

Bug #557428 reported by Chris Wagner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Resonate
Confirmed
Low
Unassigned

Bug Description

I think we ought to deal with this by catching OperationalError exceptions at the higher levels of the web stack, and check to see if it mentions something like "server closed the connection unexpectedly"; and, if so, try to process the request once more...

Here's an example stack trace...

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/__init__.py", line 20, in execute_view
    ret = view_func(request, *args, **kwargs)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/auth.py", line 18, in login_handler
    user = authenticate(username=username, password=password)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/__init__.py", line 184, in authenticate
    user = User.get_or_else(username=username)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/models.py", line 145, in get_or_else
    instance = query.filter_by(**kwargs).first()

  File "/home/chrisw/lib/python2.5/sqlalchemy/orm/query.py", line 1274, in first
    ret = list(self[0:1])

  ...

  File "/home/chrisw/lib/python2.5/sqlalchemy/engine/default.py", line 177, in do_execute
    cursor.execute(statement, parameters)

OperationalError: (OperationalError) FATAL: terminating connection due to administrator command
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
 'SELECT users.id AS users_id, users.username AS users_username, users._encrypted_password AS users__encrypted_password, users.full_name AS users_full_name, users.email AS users_email, users.location AS users_location, users.signup_comment AS users_signup_comment, users.joined_time AS users_joined_time, users.is_active AS users_is_active, users.can_request AS users_can_request, users.is_admin AS users_is_admin, users.referrer_id AS users_referrer_id \nFROM users \nWHERE users.username = %(username_1)s \n LIMIT 1 OFFSET 0' {'username_1': 'a-user'}

Changed in resonate:
status: New → Confirmed
importance: Undecided → High
Changed in resonate:
importance: High → Medium
Changed in resonate:
importance: Medium → Low
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.