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


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/ProcessBundleHandler.java:
##########
@@ -1168,13 +1172,26 @@ void discard() {
         if (this.bundleCache != null) {
           this.bundleCache.clear();
         }
+        // setupFunctions are invoked in createBundleProcessor. Invoke 
teardownFunction here as the
+        // BundleProcessor is already removed from cache and won't be re-used.
+        for (ThrowingRunnable teardownFunction : 
Lists.reverse(this.getTearDownFunctions())) {
+          try {
+            teardownFunction.run();
+          } catch (Throwable e) {
+            LOG.warn(
+                "Exceptions are thrown from DoFn.teardown method when trying 
to discard "
+                    + "ProcessBundleHandler",

Review Comment:
   adjusted to warning and wording of it. Originally it was an Error, which may 
cause confuse on the cause of the error in case of a failed pipeline (the cause 
is upstream error in processElement, etc. not tearDown throws)



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