Abacn commented on code in PR #32522:
URL: https://github.com/apache/beam/pull/32522#discussion_r1777301355


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/ProcessBundleHandler.java:
##########
@@ -1168,13 +1168,27 @@ void discard() {
         if (this.bundleCache != null) {
           this.bundleCache.clear();
         }
+        // setupFunction called in createBundleProcessor when 
BundleProcessorCache.get returns null.
+        // call teardownFunction here as the BundleProcessor is already 
removed from cache and isn't
+        // going to be re-used.
+        for (ThrowingRunnable teardownFunction : 
Lists.reverse(this.getTearDownFunctions())) {
+          try {
+            teardownFunction.run();

Review Comment:
   Tested that teardown on B isn't called, indeed. However this is same for 
legacy runner, except for legacy runner setup is called in sequence order (not 
reverse), which means if B throws in setup, tearDown in a won't be called.
   
   Prefer to note this as a separate issue for now.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to