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-562946683
 
 
   I think we still have a bit of a mismatch here, between different types. You 
can see that at the "serializable" warnings you get for the 
`RocksDBResourceContainer`. The class is serializable but contains a lot of 
non-serializable fields.
   
   We need to clearly distinguish between the handling of
     - "factories", like PredefinedOptions and the "OptionsFactory": These are 
serializable, because they do not actually contain options (with native 
objects).
     - The actual "options objects", which hold native resources.
   
   The factories are configured on the `RocksDBStateBackend` and are shipped. 
The Resources must exist only on the `RocksDBKeyedStateBackend` during Task 
execution. The `RocksDBResourceContainer` handles both: it contains the 
factories and the options (with native resources). I think that is the root of 
the inconsistency.
   
   I think the `RocksDBResourceContainer` should only be created when we create 
the keyed state backend, and not exist as a field in the `RocksDBStateBackend` 
class. Then it also would not need to be serializable, which would be 
consistent.

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