[
https://issues.apache.org/jira/browse/FLINK-39206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117671#comment-18117671
]
Martijn Visser commented on FLINK-39206:
----------------------------------------
The stack in the description stops above the root cause. {{JdbcSource}} hands
the same
{{JdbcConnectionProvider}} to every split reader, while
{{flink-connector-base}} builds one per
split fetcher, so the reader of a finished split closes the connection that the
next split's reader
is still reading from. It has hit Db2 and MySQL in the weekly builds too.
FLINK-39975 fixed one
window of this on the split-open path. I have a fix that copies the provider
per split reader.
> JDBC flaky test: java.lang.RuntimeException: Failed to fetch next result
> ------------------------------------------------------------------------
>
> Key: FLINK-39206
> URL: https://issues.apache.org/jira/browse/FLINK-39206
> Project: Flink
> Issue Type: Bug
> Components: Connectors / JDBC
> Reporter: Yuepeng Pan
> Priority: Minor
>
> https://github.com/apache/flink-connector-jdbc/actions/runs/22613827074/job/65671198135?pr=182
>
> ```
> Error: Tests run: 15, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.9
> s <<< FAILURE! - in
> org.apache.flink.connector.jdbc.derby.table.DerbyDynamicTableSourceITCase
> Error:
> org.apache.flink.connector.jdbc.derby.table.DerbyDynamicTableSourceITCase.testLimit
> Time elapsed: 0.514 s <<< ERROR!
> java.lang.RuntimeException: Failed to fetch next result
> at
> org.apache.flink.streaming.api.operators.collect.CollectResultIterator.nextResultFromFetcher(CollectResultIterator.java:127)
> at
> org.apache.flink.streaming.api.operators.collect.CollectResultIterator.hasNext(CollectResultIterator.java:98)
> at
> org.apache.flink.table.planner.connectors.CollectDynamicSink$CloseableRowIteratorWrapper.hasNext(CollectDynamicSink.java:252)
> at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
> at
> org.apache.flink.util.CollectionUtil.iteratorToList(CollectionUtil.java:133)
> at
> org.apache.flink.connector.jdbc.core.table.source.JdbcDynamicTableSourceITCase.executeQuery(JdbcDynamicTableSourceITCase.java:596)
> at
> org.apache.flink.connector.jdbc.core.table.source.JdbcDynamicTableSourceITCase.testLimit(JdbcDynamicTableSourceITCase.java:191)
> at java.base/java.lang.reflect.Method.invoke(Method.java:569)
> at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> Caused by: java.io.IOException: Failed to fetch job execution result
> at
> org.apache.flink.streaming.api.operators.collect.CollectResultFetcher.getAccumulatorResults(CollectResultFetcher.java:184)
> at
> org.apache.flink.streaming.api.operators.collect.CollectResultFetcher.next(CollectResultFetcher.java:121)
> at
> org.apache.flink.streaming.api.operators.collect.CollectResultIterator.nextResultFromFetcher(CollectResultIterator.java:124)
> ... 9 more
> Caused by: java.util.concurrent.ExecutionException:
> org.apache.flink.runtime.client.JobExecutionException: Job execution failed.
> at
> java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
> at
> java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
> at
> org.apache.flink.streaming.api.operators.collect.CollectResultFetcher.getAccumulatorResults(CollectResultFetcher.java:182)
> ... 11 more
> ```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)