[ https://issues.apache.org/jira/browse/HADOOP-17752?focusedWorklogId=609580&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609580 ]
ASF GitHub Bot logged work on HADOOP-17752: ------------------------------------------- Author: ASF GitHub Bot Created on: 10/Jun/21 09:21 Start Date: 10/Jun/21 09:21 Worklog Time Spent: 10m Work Description: liangxs edited a comment on pull request #3085: URL: https://github.com/apache/hadoop/pull/3085#issuecomment-858455111 @steveloughran Thanks for you comment. The only problem may occur as follows 0. REGISTRY contains two configurations: `conf_b` and `conf_c` 1. Thread t1 is reloading all Configurations of REGISTRY, the state and the map iterator order are [`conf_b`(reloaded💚) **->** `conf_c`(_reloading_)] 2. Meanwhile, another thread t2 creates `conf_a` and then creates `conf_d`, which are both put into REGISTRY. 3. Thread t1 continues and completes reload operation. 3. Now the state may be [`conf_a`(**not_reload**⚠️) **->** `conf_b`(reloaded💚) **->**`conf_c`(reloaded💚) **->** `conf_d`(reloaded💚)] For thread t2, `conf_a` is happen-before `conf_d`, but `conf_a` is not reloaded and `conf_d` is reloaded. I think this is ok. If this is a concern, I can add a ReentrantReadWriteLock to prevent it. The reload operation can be guard by WriteLock, because configurations are not very frequently reloaded. The put operations can be guard by ReadLock, which gain performance from parallel. -- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 609580) Time Spent: 50m (was: 40m) > Remove lock contention in REGISTRY of Configuration > --------------------------------------------------- > > Key: HADOOP-17752 > URL: https://issues.apache.org/jira/browse/HADOOP-17752 > Project: Hadoop Common > Issue Type: Sub-task > Components: common > Reporter: Xuesen Liang > Priority: Major > Labels: pull-request-available > Time Spent: 50m > Remaining Estimate: 0h > > Every Configuration instance is put into *Configuration#REGISTRY* by its > constructor. This operation is guard by Configuration.class. > REGISTRY is a *WeakHashMap*, which should be replaced by *ConcurrentHashMap*. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org