Commit 2bf02b70 authored by Martin Aspeli's avatar Martin Aspeli

Be a bit more forceful about aborting the transaction

parent 127049ad
...@@ -176,9 +176,9 @@ def publish(request, module_name, after_list, debug=0, ...@@ -176,9 +176,9 @@ def publish(request, module_name, after_list, debug=0,
# Note: 'abort's can fail. Nevertheless, we want end request handling # Note: 'abort's can fail. Nevertheless, we want end request handling
try: try:
try:
notify(PubBeforeAbort(request, exc_info, retry)) notify(PubBeforeAbort(request, exc_info, retry))
finally:
if transactions_manager: if transactions_manager:
transactions_manager.abort() transactions_manager.abort()
finally: finally:
...@@ -198,19 +198,19 @@ def publish(request, module_name, after_list, debug=0, ...@@ -198,19 +198,19 @@ def publish(request, module_name, after_list, debug=0,
newrequest.close() newrequest.close()
else: else:
# Note: 'abort's can fail. Nevertheless, we want end request handling # Note: 'abort's can fail. Nevertheless, we want end request handling
try: try:
try:
notify(PubBeforeAbort(request, exc_info, False)) notify(PubBeforeAbort(request, exc_info, False))
finally:
if transactions_manager: if transactions_manager:
transactions_manager.abort() transactions_manager.abort()
finally: finally:
endInteraction() endInteraction()
notify(PubFailure(request, exc_info, False)) notify(PubFailure(request, exc_info, retry))
raise raise
def publish_module_standard(module_name, def publish_module_standard(module_name,
stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr,
environ=os.environ, debug=0, request=None, response=None): environ=os.environ, debug=0, request=None, response=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment