Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
3c06c8dc
Commit
3c06c8dc
authored
Jul 03, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMySQLDA: Capture hosed connection errors during transction abort
Do log it, but do not let it propagate.
parent
fbeff3f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+19
-6
No files found.
product/ZMySQLDA/db.py
View file @
3c06c8dc
...
@@ -432,12 +432,25 @@ class DB(TM):
...
@@ -432,12 +432,25 @@ class DB(TM):
if
not
self
.
_transaction_begun
:
if
not
self
.
_transaction_begun
:
return
return
self
.
_transaction_begun
=
False
self
.
_transaction_begun
=
False
# Hide hosed connection exceptions:
# - if the disconnection caused the abort, we would then hide the
# original error traceback
# - if the disconnection happened during abort, then we cannot recover
# anyway as the transaction is bound to its connection anyway
# Note: in any case, we expect server to notice the disconnection and
# trigger an abort on its side.
try
:
if
self
.
_mysql_lock
:
if
self
.
_mysql_lock
:
self
.
_query
(
"SELECT RELEASE_LOCK('%s')"
%
self
.
_mysql_lock
)
self
.
_query
(
"SELECT RELEASE_LOCK('%s')"
%
self
.
_mysql_lock
)
if
self
.
_transactions
:
if
self
.
_transactions
:
self
.
_query
(
"ROLLBACK"
)
self
.
_query
(
"ROLLBACK"
)
else
:
else
:
LOG
(
'ZMySQLDA'
,
ERROR
,
"aborting when non-transactional"
)
LOG
(
'ZMySQLDA'
,
ERROR
,
"aborting when non-transactional"
)
except
OperationalError
,
m
:
LOG
(
'ZMySQLDA'
,
ERROR
,
"exception during _abort"
,
error
=
sys
.
exc_info
())
if
m
[
0
]
not
in
hosed_connection
:
raise
@
contextmanager
@
contextmanager
def
lock
(
self
):
def
lock
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment