Merge lp:~stefan-opener/therp-backports/6.1-bug-905257-fix-reconnect into lp:therp-backports/server-6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 4297
Proposed branch: lp:~stefan-opener/therp-backports/6.1-bug-905257-fix-reconnect
Merge into: lp:therp-backports/server-6.1
Diff against target: 43 lines (+11/-3)
2 files modified
openerp/sql_db.py (+10/-2)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~stefan-opener/therp-backports/6.1-bug-905257-fix-reconnect
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Pending
Review via email: mp+148115@code.launchpad.net

Description of the change

This branch is now a verbatim backport of lp:openobject-addons/7.0 -r 4838..4840

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Setting to 'work in progress' as a simpler patch has been posted here: https://code.launchpad.net/~openerp-dev/openobject-server/7.0-rstcnx-chs

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Reverted previous fix and applied fix that is now in OpenERP server 7.0

4299. By Olivier Dony (Odoo)

[FIX] sql_db: typo in previous patch for autodetection of closed connections

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Holger,

thank you for merging. Can you also approve the MP next time?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/sql_db.py'
--- openerp/sql_db.py 2012-02-06 20:31:51 +0000
+++ openerp/sql_db.py 2013-02-15 16:04:26 +0000
@@ -3,7 +3,7 @@
3#3#
4# OpenERP, Open Source Management Solution4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
6# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).6# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
7#7#
8# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
@@ -386,8 +386,16 @@
386 def borrow(self, dsn):386 def borrow(self, dsn):
387 self._debug('Borrow connection to %r', dsn)387 self._debug('Borrow connection to %r', dsn)
388388
389 # free leaked connections389 # free dead and leaked connections
390 for i, (cnx, _) in tools.reverse_enumerate(self._connections):390 for i, (cnx, _) in tools.reverse_enumerate(self._connections):
391 try:
392 cnx.reset()
393 except psycopg2.OperationalError:
394 self._debug('Cannot reset connection at index %d: %r', i, cnx.dsn)
395 # psycopg2 2.4.4 and earlier do not allow closing a closed connection
396 if not cnx.closed:
397 cnx.close()
398
391 if cnx.closed:399 if cnx.closed:
392 self._connections.pop(i)400 self._connections.pop(i)
393 self._debug('Removing closed connection at index %d: %r', i, cnx.dsn)401 self._debug('Removing closed connection at index %d: %r', i, cnx.dsn)
394402
=== modified file 'setup.py'
--- setup.py 2012-02-07 12:14:11 +0000
+++ setup.py 2013-02-15 16:04:26 +0000
@@ -100,7 +100,7 @@
100 'gdata',100 'gdata',
101 'lxml',101 'lxml',
102 'mako',102 'mako',
103 'psycopg2',103 'psycopg2 >= 2.2',
104 'pydot',104 'pydot',
105 'python-dateutil < 2',105 'python-dateutil < 2',
106 'python-ldap',106 'python-ldap',

Subscribers

People subscribed via source and target branches