You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/21 23:07:50 UTC

[GitHub] sijie opened a new pull request #1284: Improve FileInfoBackingCache

sijie opened a new pull request #1284: Improve FileInfoBackingCache
URL: https://github.com/apache/bookkeeper/pull/1284
 
 
   Descriptions of the changes in this PR:
   
   There are a couple of issues noticed in FileInfoBackingCache:
   
   1) There is a race condition in loadFileInfo between get-check and put. If concurrent loading happens, there might be a FileInfo loaded into the map after get-check. This can cause incorrect reference count on FileInfo.
   
   2) FileLoader is doing I/O operation which happens under a giant write lock.
   
   3) assert is typically not recommended since it is disabled at production runtime typically.
   
   *Changes*
   
   - Check whether fileinfo exists or not after getting write lock and before put
   - Move any I/O operations out of write lock
   - release the new FileInfo if concurrent puts happen
   - remove the usage of assert
   
   Beside that, switch to use ConcurrentLongHashMap to avoid boxing and unboxing.
   
   
   Related Issues:
   
   #913 #832 

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