Li Lu commented on YARN-3390:

Hi [~sjlee0], I think the racy situation happens like this: thread 1 and 2 try 
to update the collector for the same appId. Thread 1 arrived first, performs 
the putIfAbsent with the incoming collector and succeed. Thread 2 then come and 
grab the collector put by thread 1. If thread 1 is blocked for some reason, 
thread 2 will operate on the uninitialized collector, which may cause potential 
problems. I'm not sure how severe this problem is, but we can avoid it by 
calling putIfAbsent after we set up a collector. To avoid unnecessary collector 
setup, we can firstly check the concurrent hash map, and only perform this 
operation if a collector is not present for this application id. Not sure if 
that makes sense... 

> Reuse TimelineCollectorManager for RM
> -------------------------------------
>                 Key: YARN-3390
>                 URL: https://issues.apache.org/jira/browse/YARN-3390
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>            Reporter: Zhijie Shen
>            Assignee: Zhijie Shen
>         Attachments: YARN-3390.1.patch, YARN-3390.2.patch, YARN-3390.3.patch
> RMTimelineCollector should have the context info of each app whose entity  
> has been put

This message was sent by Atlassian JIRA

Reply via email to