SmirAlex commented on code in PR #20734:
URL: https://github.com/apache/flink/pull/20734#discussion_r970679104


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/table/lookup/fullcache/CacheLoader.java:
##########
@@ -121,8 +128,15 @@ public void run() {
 
     @Override
     public void close() throws Exception {
-        if (cache != null) {
-            cache.clear();
+        isStopped = true;
+        stopLoading();
+        reloadLock.lock(); // if reload is in progress, we will wait until it 
is over

Review Comment:
   I changed the logic, so now we firstly close `reloadTrigger`. In default 
realizations reload thread will be interrupted after that. So now we check 
interrupted state during reloading. I decided to keep `stopLoading` logic in 
case of custom triggers where we are not sure, if thread was interrupted or not.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to