Last active
February 21, 2020 19:19
-
-
Save clayg/cfbcd1235f98e1dfa55ce12a45b19b5c to your computer and use it in GitHub Desktop.
log exceptions cause duh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/swift/common/utils.py b/swift/common/utils.py | |
index 392312800..5deab454f 100644 | |
--- a/swift/common/utils.py | |
+++ b/swift/common/utils.py | |
@@ -47,6 +47,7 @@ import ctypes | |
import ctypes.util | |
from copy import deepcopy | |
from optparse import OptionParser | |
+import traceback | |
from tempfile import gettempdir, mkstemp, NamedTemporaryFile | |
import glob | |
@@ -62,7 +63,7 @@ import eventlet.semaphore | |
import pkg_resources | |
from eventlet import GreenPool, sleep, Timeout | |
from eventlet.green import socket, threading | |
-from eventlet.hubs import trampoline | |
+import eventlet.hubs | |
import eventlet.queue | |
import netifaces | |
import codecs | |
@@ -3302,6 +3303,8 @@ class GreenAsyncPile(object): | |
try: | |
self._responses.put(func(*args, **kwargs)) | |
except Exception: | |
+ if eventlet.hubs.get_hub().debug_exceptions: | |
+ traceback.print_exception(*sys.exc_info()) | |
self._responses.put(DEAD) | |
finally: | |
self._inflight -= 1 | |
@@ -5567,7 +5570,7 @@ class PipeMutex(object): | |
# Tell eventlet to suspend the current greenthread until | |
# self.rfd becomes readable. This will happen when someone | |
# else writes to self.wfd. | |
- trampoline(self.rfd, read=True) | |
+ eventlet.hubs.trampoline(self.rfd, read=True) | |
def release(self): | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment