End request handling lost when 'abort' raised an exception

Bug #277018 reported by Dieter Maurer
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Unassigned

Bug Description

"ZPublisher.Publish" contains code in two places of the form

                if transactions_manager:
                    transactions_manager.abort()
                endInteraction()

As "abort" can raise an exception, the "endInteraction" is not called in such cases (I am unsure whether this is fatal).

I suggest to use instead code of the form:

            # Note: 'abort's can fail. Nevertheless, we want end request handling
            try:
                if transactions_manager:
                    transactions_manager.abort()
            finally:
                endInteraction()

Tags: 2.11.1 zope
Revision history for this message
Hanno Schlichting (hannosch) wrote :

This is fixed in at least Zope 2.12, where the try/finally has been introduced in combination with the extra PubFailure event.

Changed in zope2:
status: New → Fix Released
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.