Merge lp:~flacoste/storm/bug-360846 into lp:~launchpad-pqm/storm/devel

Proposed by Francis J. Lacoste
Status: Merged
Merged at revision: not available
Proposed branch: lp:~flacoste/storm/bug-360846
Merge into: lp:~launchpad-pqm/storm/devel
Diff against target: 28 lines
To merge this branch: bzr merge lp:~flacoste/storm/bug-360846
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) Approve
Launchpad code reviewers from Canonical Pending
Review via email: mp+6272@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

Hi,

This should fix an important bug that we have that prevents the app servers from reconnecting to the database (and thus forcing a restart).

Since I didn't see tests for the existing ones, I didn't bother adding one.

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Francis,

This looks good.

merge-approved

-Edwin

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storm/databases/postgres.py'
2--- storm/databases/postgres.py 2008-06-06 03:00:03 +0000
3+++ storm/databases/postgres.py 2009-05-06 21:20:08 +0000
4@@ -36,7 +36,7 @@
5 from storm.variables import Variable, ListVariable, RawStrVariable
6 from storm.database import Database, Connection, Result
7 from storm.exceptions import (
8- install_exceptions, DatabaseError, DatabaseModuleError,
9+ install_exceptions, DatabaseError, DatabaseModuleError, InterfaceError,
10 OperationalError, ProgrammingError, TimeoutError)
11 from storm.tracer import TimeoutTracer
12
13@@ -285,7 +285,8 @@
14 yield param
15
16 def is_disconnection_error(self, exc):
17- if not isinstance(exc, (OperationalError, ProgrammingError)):
18+ if not isinstance(
19+ exc, (InterfaceError, OperationalError, ProgrammingError)):
20 return False
21
22 # XXX: 2007-09-17 jamesh
23@@ -296,6 +297,7 @@
24 "could not connect to server" in msg or
25 "no connection to the server" in msg or
26 "connection not open" in msg or
27+ "connection already closed" in msg or
28 "losed the connection unexpectedly" in msg)
29
30

Subscribers

People subscribed via source and target branches