Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A4940200C88 for ; Thu, 18 May 2017 21:04:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A18F0160B9D; Thu, 18 May 2017 19:04:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EFACC160BB5 for ; Thu, 18 May 2017 21:04:34 +0200 (CEST) Received: (qmail 3711 invoked by uid 500); 18 May 2017 19:04:34 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 3687 invoked by uid 99); 18 May 2017 19:04:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 May 2017 19:04:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3156CDF9A3; Thu, 18 May 2017 19:04:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chesnay@apache.org To: commits@flink.apache.org Date: Thu, 18 May 2017 19:04:35 -0000 Message-Id: <5ce387f730634803819b719c499316d9@git.apache.org> In-Reply-To: <850d994cdec94799b84ff4a8a60a1c7a@git.apache.org> References: <850d994cdec94799b84ff4a8a60a1c7a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] flink git commit: [FLINK-6416] Fix divide-by-zero in InputGateMetrics archived-at: Thu, 18 May 2017 19:04:35 -0000 [FLINK-6416] Fix divide-by-zero in InputGateMetrics Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/979228b3 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/979228b3 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/979228b3 Branch: refs/heads/release-1.3 Commit: 979228b3e2cac52c79c78855645a536d515befc9 Parents: 5569c4f Author: zentol Authored: Mon May 15 13:44:54 2017 +0200 Committer: zentol Committed: Thu May 18 17:43:08 2017 +0200 ---------------------------------------------------------------------- .../runtime/io/network/partition/consumer/InputGateMetrics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/979228b3/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java index c9fed9b..796a6db 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java @@ -130,7 +130,7 @@ public class InputGateMetrics { } } - return total / (float) count; + return count == 0 ? 0 : total / (float) count; } // ------------------------------------------------------------------------