[
https://issues.apache.org/jira/browse/FLINK-21748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17319458#comment-17319458
]
Shengkai Fang commented on FLINK-21748:
---------------------------------------
Thanks for Kurt's tips. The problem is because of multi-thread.
{{MaterializedCollectBatchResult}} extends {{CollectResultBase}}.
{{CollectResultBase}} has a thread periodically fetch data from the remote and
invoke the {{processRecord}} to add data into the `buffer`. When
{{processRecord}}, the thread needs to visit the `buffer`. The `buffer` is
created when init the child class {{MaterializedCollectBatchResult}} but the
thread is started in the init in the parent class {{CollectResultBase}}.
The solution is simple. I think we can start the thread when init
{{MaterializedCollectBatchResult}}
> LocalExecutorITCase.testBatchQueryExecutionMultipleTimes[Planner: old] fails
> ----------------------------------------------------------------------------
>
> Key: FLINK-21748
> URL: https://issues.apache.org/jira/browse/FLINK-21748
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Client
> Affects Versions: 1.13.0
> Reporter: Dawid Wysakowicz
> Assignee: Shengkai Fang
> Priority: Major
> Labels: pull-request-available, test-stability
> Fix For: 1.13.0
>
>
> https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=14520&view=logs&j=b2f046ab-ae17-5406-acdc-240be7e870e4&t=93e5ae06-d194-513d-ba8d-150ef6da1d7c&l=8800
> {code}
> [ERROR] testBatchQueryExecutionMultipleTimes[Planner:
> old](org.apache.flink.table.client.gateway.local.LocalExecutorITCase) Time
> elapsed: 0.438 s <<< ERROR!
> org.apache.flink.table.client.gateway.SqlExecutionException: Error while
> retrieving result.
> at
> org.apache.flink.table.client.gateway.local.result.CollectResultBase$ResultRetrievalThread.run(CollectResultBase.java:79)
> Caused by: java.lang.NullPointerException
> at
> org.apache.flink.table.client.gateway.local.result.MaterializedCollectBatchResult.processRecord(MaterializedCollectBatchResult.java:48)
> at
> org.apache.flink.table.client.gateway.local.result.CollectResultBase$ResultRetrievalThread.run(CollectResultBase.java:76)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)