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 04BC3200CB0 for ; Thu, 18 May 2017 21:04:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 034F8160B9D; Thu, 18 May 2017 19:04:52 +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 34F4E160BC4 for ; Thu, 18 May 2017 21:04:51 +0200 (CEST) Received: (qmail 5076 invoked by uid 500); 18 May 2017 19:04:50 -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 5006 invoked by uid 99); 18 May 2017 19:04:50 -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:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3E289E0210; Thu, 18 May 2017 19:04:50 +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:52 -0000 Message-Id: In-Reply-To: References: 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:52 -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/c995ebd2 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/c995ebd2 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/c995ebd2 Branch: refs/heads/master Commit: c995ebd290b04c6426deff5a515ab0d0f1246ac7 Parents: e03f1b5 Author: zentol Authored: Mon May 15 13:44:54 2017 +0200 Committer: zentol Committed: Thu May 18 17:44:15 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/c995ebd2/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; } // ------------------------------------------------------------------------