Skip to content

Commit

Permalink
[BEAM-7091] fix NPE in DoFnOperator#dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
je-ik committed Apr 17, 2019
1 parent 21f1b0d commit bbfe8a7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -434,9 +435,9 @@ public void open() throws Exception {
@Override
public void dispose() throws Exception {
try {
checkFinishBundleTimer.cancel(true);
Optional.ofNullable(checkFinishBundleTimer).ifPresent(timer -> timer.cancel(true));
FlinkClassloading.deleteStaticCaches();
doFnInvoker.invokeTeardown();
Optional.ofNullable(doFnInvoker).ifPresent(DoFnInvoker::invokeTeardown);
} finally {
// This releases all task's resources. We need to call this last
// to ensure that state, timers, or output buffers can still be
Expand Down

0 comments on commit bbfe8a7

Please sign in to comment.