reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julia (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (REEF-1403) Deadlock between ContextRuntime.StartTask and HeartBeatManager.OnNext(Alarm)
Date Thu, 26 May 2016 21:08:12 GMT

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

Julia commented on REEF-1403:
-----------------------------

I consistently get deadlock today in my test scenario. 

In IMRU GC scenario, I stopped one task, it returns from call() but stuck at
VERBOSE: Before acquiring lock: HeartbeatManager::OnNext(TaskStatusProto)
Org.Apache.REEF.Common.Runtime.Evaluator.HeartBeatManager Verbose: 0 : 2016-05-26T13:08:01.4484159-07:00
0001
VERBOSE: Before acquiring lock: HeartbeatManager::OnNext(Alarm)

In other tasks, if I enforce to close by throwing exceptions, I get failed task event as expected.


This doesn't happen in single task cases without GC. 


> Deadlock between ContextRuntime.StartTask and HeartBeatManager.OnNext(Alarm)
> ----------------------------------------------------------------------------
>
>                 Key: REEF-1403
>                 URL: https://issues.apache.org/jira/browse/REEF-1403
>             Project: REEF
>          Issue Type: Bug
>          Components: REEF.NET Evaluator
>            Reporter: Mariia Mykhailova
>            Assignee: Andrew Chung
>
> We have a potential deadlock in task start/timed heartbeats.
> {{ContextRuntime.StartTask}} does the following:
> 1. Acquires lock on {{ContextRuntime._contextLifeCycle}}
> 2. Calls {{TaskRuntime.RunTask()}} which calls {{TaskStatus.setInit}} which calls {{HeartBeatManager.onNext(TaskStatusProto)}}
which acquires lock on {{HeartBeatManager}} itself.
> At the same time {{HeartBeatManager.onNext(Alarm)}} gets called every 4 seconds since
evaluator start, and it:
> 1. Acquires lock on {{HeartBeatManager}}.
> 2. Calls {{GetEvaluatorHeartbeatProto}} which calls {{ContextManager.GetTaskStatus()}}
which calls {{ContextManager.GetTaskStatus()}} which acquires lock on {{ContextRuntime._contextLifeCycle}}.
> If task will be starting at the same time as heartbeat kick in, these two actions will
deadlock each other. I encountered a repro on our tests when working on REEF-1388, but in
general case it's not impossible that second or third task that starts on evaluator runs into
a heartbeat.



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

Mime
View raw message