StephanEwen commented on issue #11018: [FLINK-15905][runtime] Fix race 
condition between allocation and release of OpaqueMemoryResource
URL: https://github.com/apache/flink/pull/11018#issuecomment-582369183
 
 
   I added the following comment to the 
`MemoryManager.getSharedMemoryResourceForManagedMemory(...)` method to clarify 
that:
   
   ```
   <b>Important:</b> The failure semantics are as follows: If the memory 
manager fails to reserve
   the memory, the external resource initializer will not be called. If an 
exception is thrown when the
   opaque resource is closed (last lease is released), the memory manager will 
still un-reserve the
   memory to make sure its own accounting is clean. The exception will need to 
be handled by the caller of
   {@link OpaqueMemoryResource#close()}. For example, if this indicates that 
native memory was not released
   and the process might thus have a memory leak, the caller can decide to kill 
the process as a result.
   ```

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