You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/09/05 06:58:03 UTC

[GitHub] [incubator-livy] jerryshao commented on a change in pull request #224: [LIVY-633][Server] session should not be gc-ed for long running queries

jerryshao commented on a change in pull request #224: [LIVY-633][Server] session should not be gc-ed for long running queries
URL: https://github.com/apache/incubator-livy/pull/224#discussion_r321099292
 
 

 ##########
 File path: server/src/main/scala/org/apache/livy/server/interactive/InteractiveSession.scala
 ##########
 @@ -626,4 +626,16 @@ class InteractiveSession(
   }
 
   override def infoChanged(appInfo: AppInfo): Unit = { this.appInfo = appInfo }
+
+  override def lastActivity: Long = {
+    val serverSideLastActivity = super.lastActivity
+    if (serverSideState == SessionState.Running) {
+      // If the rsc client is running, we compare the lastActivity of the session and the repl,
+      // and return the more latest one
+      client.flatMap(s => Option(s.getReplLastActivity)).filter(_ > serverSideLastActivity)
 
 Review comment:
   nit: `client.flatMap { s => Option(s.getxxx) }`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services