Tolerate null source_elapsed in trace events

For PYTHON-48
This commit is contained in:
Tyler Hobbs
2014-02-19 11:20:36 -06:00
parent 0cf69b5c04
commit 250ee6a6fc
2 changed files with 6 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ Bug Fixes
* Handle data that is already utf8-encoded for UTF8Type values
* Fix token-aware routing for tokens that fall before the first node token in
the ring and tokens that exactly match a node's token
* Tolerate null source_elapsed values for Trace events. These may not be
set when events complete after the main operation has already completed.
Other
-----

View File

@@ -489,7 +489,10 @@ class TraceEvent(object):
self.description = description
self.datetime = datetime.utcfromtimestamp(unix_time_from_uuid1(timeuuid))
self.source = source
self.source_elapsed = timedelta(microseconds=source_elapsed)
if source_elapsed is not None:
self.source_elapsed = timedelta(microseconds=source_elapsed)
else:
self.source_elapsed = None
self.thread_name = thread_name
def __str__(self):