You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/11/18 04:20:49 UTC
[incubator-superset] branch master updated: [druid] Catch IOError
when fetching Druid datasource time boundary (#3897)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 3a7ed8d [druid] Catch IOError when fetching Druid datasource time boundary (#3897)
3a7ed8d is described below
commit 3a7ed8d19416979754bbdddb06ea54799c14f151
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Fri Nov 17 20:20:47 2017 -0800
[druid] Catch IOError when fetching Druid datasource time boundary (#3897)
---
superset/connectors/druid/models.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py
index c91dc71..6bf39f2 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -564,11 +564,15 @@ class DruidDatasource(Model, BaseDatasource):
"""Returns segment metadata from the latest segment"""
logging.info('Syncing datasource [{}]'.format(self.datasource_name))
client = self.cluster.get_pydruid_client()
- results = client.time_boundary(datasource=self.datasource_name)
- if not results:
- return
- max_time = results[0]['result']['maxTime']
- max_time = dparse(max_time)
+ try:
+ results = client.time_boundary(datasource=self.datasource_name)
+ except IOError:
+ results = None
+ if results:
+ max_time = results[0]['result']['maxTime']
+ max_time = dparse(max_time)
+ else:
+ max_time = datetime.now()
# Query segmentMetadata for 7 days back. However, due to a bug,
# we need to set this interval to more than 1 day ago to exclude
# realtime segments, which triggered a bug (fixed in druid 0.8.2).
--
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].