apache / beam

Apache Beam is a unified programming model for Batch and Streaming data processing.
https://beam.apache.org/
Apache License 2.0
7.79k stars 4.22k forks source link

[Bug]: IllegalArgumentException during bundle split in FnApiDoFnRunner.scaleProgress #23881

Closed scwhittle closed 1 year ago

scwhittle commented 1 year ago

What happened?

Full stack trace (ocr from image so may be slightly off): "java.lang.IllegalArgumentException: Work completed and work remaining must be greater than or equal to zero but were 3.332476747E9 and -1.666238373E9. Consumer Registry.java:434) } at org.apache.beam.sdk.transforms.splittabledofn. Restriction Tracker $Progress. from (RestrictionTracker.java:189) at org.apache.beam.fn.harness.FnApiDoFnRunner.scale Progress (FnApiDoFnRunner.java:1183) at org.apache.beam.fn.harness. FnApiDoFnRunner.getProgress (FnApiDoFnRunner.java:1157) at org.apache.beam.fn.harness.FnApiDoFnRunner.access$1700 (FnApiDoFnRunner.java:145) at org.apache.beam.fn.harness. FnApiDoFnRunner$SplittableFnDataReceiver.getProgress (FnApiDoFnRunner.java:1143) at org.apache.beam.fn.harness.data.PCollectionConsumer Registry$SplittingMetricTrackingFnDataReceiver.getProgress (PCollection at org.apache.beam.fn.harness. BeamFnDataReadRunner.trySplit (BeamFnDataReadRunner.java:266) at org.apache.beam.fn.harness.control. ProcessBundleHandler.trySplit (ProcessBundleHandler.java:728) at org.apache.beam.fn.harness.control. BeamFnControlClient.delegateOnInstruction RequestType(BeamFnControlClient.java:151) at org.apache.beam.fn.harness.control. BeamFnControlClient$InboundObserver.lambda$onNext$0 (BeamFnControlClient.java:116) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)

Since the input progress was constructed successfully and thus has positive fields it seems that windowCurrentIndex >= windowStopIndex must be true, causing the work remaining to be multipled by a negative value. It seems this may be possible due to a race between windowCurrentIndex being incremented to windowStopIndex and the tracker/window being set to null preventing getProgress from running.

Issue Priority

Priority: 2

Issue Component

Component: sdk-java-harness

scwhittle commented 1 year ago

.take-issue