[ 
https://issues.apache.org/jira/browse/FLINK-5002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15644500#comment-15644500
 ] 

Stephan Ewen commented on FLINK-5002:
-------------------------------------

I am skeptical about that - these methods are used by metric gauges and should 
not interfere with the main threads.

Alternatively, we could rename the methods to {{bestEffortGetNumBuffers()}} and 
make sure they at least do not return a negative value.

> Lack of synchronization in LocalBufferPool#getNumberOfUsedBuffers
> -----------------------------------------------------------------
>
>                 Key: FLINK-5002
>                 URL: https://issues.apache.org/jira/browse/FLINK-5002
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>   public int getNumberOfUsedBuffers() {
>     return numberOfRequestedMemorySegments - availableMemorySegments.size();
>   }
> {code}
> Access to availableMemorySegments should be protected with proper 
> synchronization as other methods do.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to