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

Asif Khatri commented on LIVY-976:
----------------------------------

After analysing this, I found that Interactive Session Servlet can update 
session's heartbeat whenever a /sessions/:id REST call is made. e.g. GET 
/sessions/:id
+Note:+ GET /sessions doesn't update heartbeats.
+Reference 1:+ 
[https://github.com/apache/incubator-livy/blob/master/server/src/main/scala/org/apache/livy/server/interactive/SessionHeartbeat.scala#L51-L55]

The user of an interactive session has to constantly call an API (could be just 
GET /sessions/id) defined only in interactive session to keep that session 
alive. Otherwise, it will expire and will terminate. With this, it looks like 
the functionality is working as per the implementation as part of LIVY-165.
+Reference 2:+ 
https://issues.apache.org/jira/browse/LIVY-165?focusedCommentId=16132616&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16132616

For following HTTP GET APIs, Heartbeat is getting reset:
{{/sessions/\{sessionId}}}
{{/sessions/\{sessionId}/state}}
{{/sessions/\{sessionId}/log}}
{{/sessions/\{sessionId}/statements}}
{{/sessions/\{sessionId}/statements/\{statementId}}}

> HeartbeatTimeoutInSeconds resets if /sessions is called.
> --------------------------------------------------------
>
>                 Key: LIVY-976
>                 URL: https://issues.apache.org/jira/browse/LIVY-976
>             Project: Livy
>          Issue Type: Bug
>          Components: API, Server
>            Reporter: Vedant Lodha
>            Assignee: Asif Khatri
>            Priority: Major
>
> Based on description in the docs
> heartbeatTimeoutInSecond: Timeout in second to which session be orphaned
>  
> Were trying to create a session with heartbeattimeout as 10 minutes(600 s). 
> The expectation is, if the session is idle for 10 mins, it should be killed.
> However the observation is,
> Since were poling for each session, calling /session/\{sessionid}, the 
> session doesnt timeout even when idle, whereas calling /session causes the 
> session to timeout if idle.
>  
> This shouldnt be the case. internal timer should reset only when a statement 
> is run against a session.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to