You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2026/08/05 05:06:24 UTC

[I] [test] Unstable test Flink118TableSourceBatchITCase.testLogTableBatchScanSupportsNonFullStartupMode [fluss]

github-actions[bot] opened a new issue, #3856:
URL: https://github.com/apache/fluss/issues/3856

   https://github.com/apache/fluss/actions/runs/30948293084/job/92123675584
   
   ```
   [ERROR] org.apache.fluss.flink.source.Flink118TableSourceBatchITCase.testLogTableBatchScanSupportsNonFullStartupMode  Time elapsed: 3.764 s  <<< ERROR!
   java.lang.RuntimeException: Unexpected error after waiting 2633 ms for Flink job results. Expected 1 records but got 0 before error occurred.
   	at org.apache.fluss.flink.source.testutils.FlinkRowAssertionsUtils.collectRowsWithTimeout(FlinkRowAssertionsUtils.java:169)
   	at org.apache.fluss.flink.source.testutils.FlinkRowAssertionsUtils.collectRowsWithTimeout(FlinkRowAssertionsUtils.java:105)
   	at org.apache.fluss.flink.source.testutils.FlinkRowAssertionsUtils.collectRowsWithTimeout(FlinkRowAssertionsUtils.java:93)
   	at org.apache.fluss.flink.source.FlinkTableSourceBatchITCase.testLogTableBatchScanSupportsNonFullStartupMode(FlinkTableSourceBatchITCase.java:516)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
   	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
   	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
   	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
   	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
   	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
   	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
   	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
   	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
   ... (truncated)
   ```
   


-- 
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: issues-unsubscribe@fluss.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [test] Unstable test Flink118TableSourceBatchITCase.testLogTableBatchScanSupportsNonFullStartupMode [fluss]

Posted by "vbhanuchander-lang (via GitHub)" <gi...@apache.org>.
vbhanuchander-lang commented on issue #3856:
URL: https://github.com/apache/fluss/issues/3856#issuecomment-5261293829

   The root cause is not visible in the report, and I do not think this is test flakiness. I pulled the job log from the linked run ([job 92123675584](https://github.com/apache/fluss/actions/runs/30948293084/job/92123675584)); the failure is six `Caused by` levels below the message in the issue body:
   
   ```
   Caused by: java.lang.RuntimeException: Error checking iterator.hasNext()
   Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Failed to fetch next result
   Caused by: java.io.IOException: Failed to fetch job execution result
   Caused by: org.apache.flink.runtime.client.JobExecutionException: Job execution failed.
   Caused by: org.apache.flink.runtime.JobException: Recovery is suppressed by NoRestartBackoffTimeStrategy
   Caused by: java.lang.IllegalStateException: Have records for a split that was not registered
   	at org.apache.flink.util.Preconditions.checkState(Preconditions.java:193)
   	at org.apache.flink.connector.base.source.reader.SourceReaderBase.moveToNextSplit(SourceReaderBase.java:229)
   	at org.apache.flink.connector.base.source.reader.SourceReaderBase.getNextFetch(SourceReaderBase.java:189)
   	at org.apache.flink.connector.base.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:147)
   ```
   
   The job **failed**; the "Expected 1 records but got 0" message is the test utility reporting the consequence. That also explains the 2633 ms wait against a one-minute timeout — it did not time out.
   
   `SourceReaderBase` throws that when `RecordsWithSplitIds.nextSplit()` returns a split id that is not in the reader's `splitStates`, i.e. the fetcher emitted records for a split the reader has already unregistered.
   
   **Likely mechanism** — stated as a hypothesis, from reading `FlinkSourceSplitReader` rather than from a reproduction:
   
   In `forLogRecords`, the split is added to the returned records **unconditionally**, outside the emptiness check that decides whether it is finished:
   
   ```java
   List<ScanRecord> bucketScanRecords = scanRecords.records(scanBucket);
   if (!bucketScanRecords.isEmpty()) {
       ...
       if (lastRecord.logOffset() >= stoppingOffset - 1) {
           stoppingOffsets.put(scanBucket, stoppingOffset);
           finishedSplits.add(splitId);          // reader will unregister this split
       }
   }
   splitRecords.put(splitId, toRecordAndPos(bucketScanRecords.iterator()));   // still added, even when empty
   ```
   
   and `subscribedBuckets` is pruned only when a **partition** disappears — that `while` loop is guarded by `removedPartitions.containsKey(...)`. Finishing a split does not remove its bucket from `subscribedBuckets`.
   
   So: fetch *N* reports the split finished and the reader unregisters it; `subscribedBuckets` still maps the bucket to that split id; if the scanner returns that bucket again in fetch *N+1* — even with **zero** records — `forLogRecords` resolves the id, puts it in `splitRecords` and `tableScanBuckets`, and `nextSplit()` hands the reader a split it no longer knows about.
   
   That would explain why it is intermittent: it needs the bucket to come back in a later fetch after the split has already finished, which is timing-dependent.
   
   **What I have not verified**: whether the log scanner can in fact return a bucket after its stopping offset has been set, which is the one link that makes the above reachable. If it cannot, the mechanism is something else and the invariant is being broken another way.
   
   Two suggestions regardless of mechanism:
   
   1. This is a source bug surfacing as test flakiness, so the `[test] Unstable test ...` title is misleading — anyone triaging the flaky-test list will keep skipping it. Worth retitling.
   2. `FlinkRowAssertionsUtils` does chain the cause correctly (`throw new RuntimeException(msg, e)`), so nothing is being swallowed — the loss happens when the bot copies only the head of the trace into the issue. Including the deepest `Caused by` in these auto-filed reports would make the whole flaky list far more actionable. I checked #3877 and #3879 and both have the same shape: symptom only, no root cause.
   
   Happy to dig into a fix if the hypothesis looks right to you, or to test it if you can tell me whether a finished bucket can reappear in a later fetch.


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org