beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [beam] mxm commented on a change in pull request #11084: [BEAM-9474] Improve robustness of BundleFactory and ProcessEnvironment
Date Wed, 11 Mar 2020 20:45:31 GMT
mxm commented on a change in pull request #11084: [BEAM-9474] Improve robustness of BundleFactory
and ProcessEnvironment
URL: https://github.com/apache/beam/pull/11084#discussion_r391257741
 
 

 ##########
 File path: runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DefaultJobBundleFactory.java
 ##########
 @@ -487,13 +553,14 @@ private int ref() {
     }
 
     private int unref() {
-      int count = bundleRefCount.decrementAndGet();
-      if (count == 0) {
+      int refCount = bundleRefCount.decrementAndGet();
+      Preconditions.checkState(refCount >= 0, "Reference count must not be negative.");
 
 Review comment:
   FYI, I've added this check instead to check for correct bounds.

----------------------------------------------------------------
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

Mime
View raw message