You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/12/20 14:52:53 UTC

[GitHub] zentol opened a new pull request #7347: [FLINK-10761][metrics] Do not acquire lock for getAllVariables()

zentol opened a new pull request #7347: [FLINK-10761][metrics] Do not acquire lock for getAllVariables()
URL: https://github.com/apache/flink/pull/7347
 
 
   ## What is the purpose of the change
   
   With this PR we no longer acquire a lock in `AbstractMetricGroup#getAllVariables`. Doing this can cause deadlocks if metrics are registered concurrently on child&parent groups, if these methods are used by the reporter.
   
   This should not have any real effect on Flink. In the worst case the variables map is initialized multiple times, but this is just as unlikely as the deadlock, but with a significantly less severe outcome.
   
   ## Brief change log
   
   * remove locking in `AbstractMetricGroup#getAllVariables`
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   * `AbstractMetricGroupTest#testGetAllVariablesDoesNotDeadlock` verifies that getAllVariables does not deadlock if a registration on the parent group is in progress

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services