Skip to content

Commit 03e281d

Browse files
committed
Add PermissionDenied exception to retry decorator
We have seen several cases where Pub tasks fail because the worker gets a permission denied error, immediately after successfully logging in. We believe that these are false negatives, which can be resolved by a simple retry.
1 parent b4b486f commit 03e281d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kobo/xmlrpc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from __future__ import print_function
55
import base64
6+
from django.core.exceptions import PermissionDenied
67
import six.moves.http_cookiejar as cookielib
78
import fcntl
89
import hashlib
@@ -479,7 +480,8 @@ def request(self, *args, **kwargs):
479480
except KeyboardInterrupt:
480481
raise
481482
except (socket.error, socket.herror, socket.gaierror, socket.timeout,
482-
httplib.CannotSendRequest, xmlrpclib.ProtocolError) as ex:
483+
httplib.CannotSendRequest, xmlrpclib.ProtocolError,
484+
PermissionDenied) as ex:
483485
if i >= self.retry_count:
484486
raise
485487
retries_left = self.retry_count - i

0 commit comments

Comments
 (0)