Retry on ConflictError is broken #413
Comments
Yes, that makes a lot of sense. I'm guessing you're referring to Zope/src/ZPublisher/WSGIPublisher.py Line 170 in ba72a30 ConflictError to the condition, right?
|
Fixed in 4dc1700 - there was just a single place in the whole code base that referenced both error types at the same time. |
@dataflake wrote:
Yes, I think this should be enough. |
Zope/src/ZPublisher/WSGIPublisher.py Line 170 in ba72a30 @icemac Maybe its too late and I am having a brain fart, but if an exception view for |
@dataflake You are right: creating |
If you don't have the |
Regarding HTTPRequest.supports_retry(): My naive expectation would have been that there is a method for checking and one for doing the actual wait. @dataflake You are right we can postpone this to Zope 5. I have created #474 for this issue. |
Retrying of requests in case of an
ConflictError
is broken on multiple levels:max_conflict_retries
in zope.conf See [1] below.Exception
is reqistered it has to reraiseConflictException
otherwise it will not be handled by the retry mechanism. See [2] below.ConflictError
is a subclass ofTransientError
, the code using both can be simplified. See [4] below.HTTPRequest.supports_retry() sleeps when called. See [5] below.Moved to #474.[1] The default used to be
3
in Zope 2.13 but was changed in 740eb60 to0
. In 40e5f99 the ability to change the default was added but it sets the value onZPublisher.HTTPRequest
(the module) instead ofZPublisher.HTTPRequest.HTTPRequest
(the class), so it does not have the expected effect.[2] This seems unexpected to me. Maybe ConflictError should be handled separately like it is already done for
Unauthorized
.[3] The
request.close()
in the finally block (see WSGIPublisher.publish_module) closes the newly created request, so it is empty during the retry.[4] Since zopefoundation/ZODB@364b2a2 a ZODB
ConflictError
is a subclass of transaction'sTransientError
. The commit is part of ZODB 3.10+.[5] I'd not expect that a method called
supports_retry
does the actual sleeping. It is called three times when aConflictError
happens.The text was updated successfully, but these errors were encountered: