Abacn commented on code in PR #32522:
URL: https://github.com/apache/beam/pull/32522#discussion_r1773512065
##########
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:
If the question is about throw the exception in `setupFunction`, then
tearDown is invoked earlier, at
https://github.com/apache/beam/blob/c3be9f096f0e28e6bcc5fc9ecf73015f4dd78b57/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java#L56
and createBundleProcessor won't complete and discard() method won't invoked
--
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]