Skip to content

Instantly share code, notes, and snippets.

@clayg
Created September 22, 2016 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayg/d8e2ed3e9ad55cd287da917be5ff0efe to your computer and use it in GitHub Desktop.
Save clayg/d8e2ed3e9ad55cd287da917be5ff0efe to your computer and use it in GitHub Desktop.
how to find ChunkWriteTimeout
diff --git a/swift/common/exceptions.py b/swift/common/exceptions.py
index f3e6337..c1dbea4 100644
--- a/swift/common/exceptions.py
+++ b/swift/common/exceptions.py
@@ -126,7 +126,22 @@ class ChunkReadTimeout(Timeout):
class ChunkWriteTimeout(Timeout):
- pass
+
+ def __init__(self, timeout):
+ if timeout == 60:
+ stack = []
+ import inspect
+ frame = inspect.currentframe()
+ while frame.f_back and len(stack) < 30:
+ stack.append(str(frame.f_code))
+ frame = frame.f_back
+ self.stack = stack
+ super(ChunkWriteTimeout, self).__init__(timeout)
+
+ def __str__(self):
+ if hasattr(self, 'stack'):
+ return ''.join(self.stack)
+ return super(ChunkWriteTimeout, self).__str__()
class ConnectionTimeout(Timeout):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment