You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gobblin.apache.org by hu...@apache.org on 2020/06/22 19:23:04 UTC

[incubator-gobblin] branch master updated: [GOBBLIN-1200] Fix bug when local network throttling distcp jobs

This is an automated email from the ASF dual-hosted git repository.

hutran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-gobblin.git


The following commit(s) were added to refs/heads/master by this push:
     new 44e419c  [GOBBLIN-1200] Fix bug when local network throttling distcp jobs
44e419c is described below

commit 44e419c14d54b2fc7e2d7a8d8287804e9e2783e8
Author: Jack Moseley <jm...@linkedin.com>
AuthorDate: Mon Jun 22 12:22:54 2020 -0700

    [GOBBLIN-1200] Fix bug when local network throttling distcp jobs
    
    Closes #3047 from jack-moseley/local-thottle-fix
---
 .../src/main/java/org/apache/gobblin/util/io/ThrottledInputStream.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gobblin-utility/src/main/java/org/apache/gobblin/util/io/ThrottledInputStream.java b/gobblin-utility/src/main/java/org/apache/gobblin/util/io/ThrottledInputStream.java
index fd2edb0..5400dd0 100644
--- a/gobblin-utility/src/main/java/org/apache/gobblin/util/io/ThrottledInputStream.java
+++ b/gobblin-utility/src/main/java/org/apache/gobblin/util/io/ThrottledInputStream.java
@@ -85,6 +85,9 @@ public class ThrottledInputStream extends FilterInputStream {
       long currentCount = this.meter.getBytesProcessedMeter().getCount();
       long permitsNeeded = currentCount - this.prevCount;
       this.prevCount = currentCount;
+      if (permitsNeeded == 0L) {
+        return;
+      }
       Closeable permit = this.limiter.acquirePermits(permitsNeeded);
       if (permit == null) {
         throw new RuntimeException("Could not acquire permits.");