twalthr commented on a change in pull request #7265: [FLINK-10964] SQL-client 
throws exception when paging through finished batch query
URL: https://github.com/apache/flink/pull/7265#discussion_r247493415
 
 

 ##########
 File path: 
flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliResultView.java
 ##########
 @@ -150,9 +150,12 @@ protected void openRow() {
                view.open(); // enter view
        }
 
-       protected void stopRetrieval() {
+       protected void stopRetrieval(boolean cleanUpQuery) {
                // stop retrieval
-               refreshThread.isRunning = false;
+               if (refreshThread.isRunning) {
 
 Review comment:
   This change does still not fix the potential concurrency issue that I 
mentioned. Once `isRunning` is set to `false` the other thread might check for 
the `cleanUpQuery` value before the next line in this thread is evaluated. A 
proper implementation looks like:
   
   ```
   refreshThread.cleanUpQuery = cleanUpQuery;
   refreshThread.isRunning = false;
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to