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


##########
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:
   the DoFnInvoker link where teardown is called if exception during startup is 
for a single DoFn.
   
   If we have fused DoFnA->DoFnB we start in reverse order. If A throws 
exception in setup, tearDown is invoked on DoFnA. Do we call teardown on B 
which had startup invoked?  If not we probably need some try catch in 
createBundleProcessor to invoke the added teardown functions.



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