StephanEwen commented on issue #10300: [FLINK-14926] [state backends] Make sure 
no resource leak of RocksObject
URL: https://github.com/apache/flink/pull/10300#issuecomment-562619090
 
 
   How about this: We change the `OptionsFactory` that way:
   
   ```
   public interface OptionsFactory extends java.io.Serializable {
   
       DBOptions createDBOptions(DBOptions currentOptions, 
Collection<AutoClosable> handlesToClose);
   }
   ```
   
   Any handle created in that method can be added to that set, and the 
container will close those once the keyed state backend is cleared. The 
DBOptions object itself can also be in that collection so we only need to close 
one collection in the end.
   
   The same trick also works for the PredefinedOptions.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to