smiklosovic commented on code in PR #4667:
URL: https://github.com/apache/cassandra/pull/4667#discussion_r2925962480


##########
src/java/org/apache/cassandra/db/compression/CompressionDictionaryScheduler.java:
##########
@@ -206,23 +240,36 @@ public void run()
                                logger.info("SSTable-based dictionary training 
completed for {}.{}",
                                            keyspaceName, tableName);
                            }
+
+                           finishTraining(trainer.getTrainingState());
+                           cleanup(refViewFragment, trainer);
                        });
             }
             catch (Exception e)
             {
                 logger.error("Failed to sample from SSTables for {}.{}", 
keyspaceName, tableName, e);
-                cancelManualTraining();
-            }
-            finally
-            {
-                refViewFragment.close();

Review Comment:
   I do not think what we did here was too smart (same concept was there before 
we started to `selectAndReference`) because training is done asychronously, so 
this method returns and `finally` is called _before_ the sampling is actually 
finished. We should close in callback, as done above, or only in case we catch 
exception, as done here.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to