From notifications-return-20819-archive-asf-public=cust-asf.ponee.io@superset.apache.org Thu May 16 04:11:17 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6D75D180621 for ; Thu, 16 May 2019 06:11:17 +0200 (CEST) Received: (qmail 62011 invoked by uid 500); 16 May 2019 04:11:16 -0000 Mailing-List: contact notifications-help@superset.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.apache.org Delivered-To: mailing list notifications@superset.apache.org Received: (qmail 62001 invoked by uid 99); 16 May 2019 04:11:16 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2019 04:11:16 +0000 From: GitBox To: notifications@superset.apache.org Subject: [GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #7446: feat: Scheduling queries from SQL Lab (#7416) Message-ID: <155797987633.13098.12012317438580953601.gitbox@gitbox.apache.org> Date: Thu, 16 May 2019 04:11:16 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit graceguo-supercat commented on a change in pull request #7446: feat: Scheduling queries from SQL Lab (#7416) URL: https://github.com/apache/incubator-superset/pull/7446#discussion_r284513097 ########## File path: superset/assets/src/SqlLab/components/QueryAutoRefresh.jsx ########## @@ -41,10 +41,18 @@ class QueryAutoRefresh extends React.PureComponent { const { queries, queriesLastUpdate } = this.props; const now = new Date().getTime(); + // due to a race condition, queries can be marked as successful before the + // results key is set; this is a workaround until we fix the underlying + // problem + const isQueryRunning = q => ( + ['running', 'started', 'pending', 'fetching'].indexOf(q.state) >= 0 || + (q.state === 'success' && q.resultsKey === null) Review comment: @DiggidyDave this logic is problematic. Sql Lab can run async and synchronous queries. For synchronous queries, it will not have a resultsKey. the new logic will make extra polling happen when user has at least 1 synchronous query (and < 6 hours old). For synchronous queries, results are returned from sql_json request, polling should not happen. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org For additional commands, e-mail: notifications-help@superset.apache.org