Wrong response code logged after ConflictError retries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Unassigned |
Bug Description
If there is at least one ConflictError and then the request finishes with an error (either more ConflictErrors or something else), the Z2 log shows the request as having been answered with status 200, although actually a status 500 error response has been served.
I've managed to work out what's causing this, but fixing may be more fiddly. What happens is, once the request is abandoned because of the error, when control comes back to publish_
Changed in zope2: | |
status: | New → Confirmed |
On the mailing list, Dieter investigated further:
A nasty workaround may be, to call "response. exception" startup. zpublisher_ exception_ hook":
for the repeated request as well.
In order not to make implementations assumptions,
this should be done in "Zope.App.
The complete block starting with
try: published, '__error_log__', containment=1)
log = aq_acquire(
and ending just before the "finally:"
may be wrapped into a
try: exception( )
<block>
except:
response = getattr(REQUEST, 'response', None)
if response is not None:
response.
raise
Of course, the complete handling is so complex that is cries
out for simplification rather than further nasty workarounds...