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

Sangjin Lee commented on YARN-3367:
-----------------------------------

{quote}
You mean that flush need not be coupled with the sync call ? if so will we be 
exposing one more interface in client side ? Felt coupling flush with sync was 
a better option.
{quote}

I meant either coupling async with no flush or coupling sync with explicit 
flush. But I vaguely remember [~djp] was of the opinion that sync doesn't 
necessarily imply flush. So this requires a more discussion.

{quote}
Agree with your points only concerned what were issues/points Junping Du had, 
when he had mentioned in the description as

3. The sequence of events could be out of order because each posting operation 
thread get out of waiting loop randomly. We should have something like event 
loop in TimelineClient side, putEntities() only put related entities into a 
queue of entities and a separated thread handle to deliver entities in queue to 
collector via REST call.
{quote}

Yes, understood. I guess I am trying to say that even if we can preserve the 
order of event writing, there is still no hard guarantee that they will be 
received by the server in the same order. Therefore, I am of the opinion that 
we do not need to spend too much effort ensuring this order (would be nice, but 
would not be fatal if we didn't do it). The server would just need to rely on 
explicit timestamps if it needs to determine the order of events.

> Replace starting a separate thread for post entity with event loop in 
> TimelineClient
> ------------------------------------------------------------------------------------
>
>                 Key: YARN-3367
>                 URL: https://issues.apache.org/jira/browse/YARN-3367
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Junping Du
>            Assignee: Naganarasimha G R
>         Attachments: YARN-3367.YARN-2928.001.patch
>
>
> Since YARN-3039, we add loop in TimelineClient to wait for 
> collectorServiceAddress ready before posting any entity. In consumer of  
> TimelineClient (like AM), we are starting a new thread for each call to get 
> rid of potential deadlock in main thread. This way has at least 3 major 
> defects:
> 1. The consumer need some additional code to wrap a thread before calling 
> putEntities() in TimelineClient.
> 2. It cost many thread resources which is unnecessary.
> 3. The sequence of events could be out of order because each posting 
> operation thread get out of waiting loop randomly.
> We should have something like event loop in TimelineClient side, 
> putEntities() only put related entities into a queue of entities and a 
> separated thread handle to deliver entities in queue to collector via REST 
> call.



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

Reply via email to