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

2019-09-09 Thread GitBox
yiheng 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_r322137333
 
 

 ##
 File path: rsc/src/main/java/org/apache/livy/rsc/RSCClient.java
 ##
 @@ -411,6 +424,11 @@ private void handle(ChannelHandlerContext ctx, JobStarted 
msg) {
 
 private void handle(ChannelHandlerContext ctx, ReplState msg) {
   LOG.trace("Received repl state for {}", msg.state);
+  // Update last activity timestamp when state change is from busy to idle.
+  if (SessionState.Busy$.MODULE$.state().equals(replState) && msg != null 
&&
 
 Review comment:
   According to 
[this](https://github.com/apache/incubator-livy/blob/master/repl/src/main/scala/org/apache/livy/repl/Session.scala#L263),
 the repl state can be changed to idle or error. However, error is a finished 
state. So we will check idle here.


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


With regards,
Apache Git Services


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

2019-09-09 Thread GitBox
yiheng 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_r322101245
 
 

 ##
 File path: rsc/pom.xml
 ##
 @@ -49,6 +49,11 @@
   ${project.version}
   test
 
+
 
 Review comment:
   We need to access the state class in rsc now.


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


With regards,
Apache Git Services


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

2019-09-05 Thread GitBox
yiheng 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_r321209809
 
 

 ##
 File path: 
server/src/test/scala/org/apache/livy/server/interactive/InteractiveSessionSpec.scala
 ##
 @@ -247,6 +247,21 @@ class InteractiveSessionSpec extends FunSpec
   }
 }
 
+withSession("should refresh last activity time when statement finished") { 
session =>
 
 Review comment:
   This test is running in unit test


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


With regards,
Apache Git Services


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

2019-09-05 Thread GitBox
yiheng 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_r321206825
 
 

 ##
 File path: rsc/src/main/java/org/apache/livy/rsc/RSCClient.java
 ##
 @@ -411,6 +425,10 @@ private void handle(ChannelHandlerContext ctx, JobStarted 
msg) {
 
 private void handle(ChannelHandlerContext ctx, ReplState msg) {
   LOG.trace("Received repl state for {}", msg.state);
+  // Update last activity timestamp when there's state change.
+  if (replState == null || !replState.equals(msg.state)) {
 
 Review comment:
   sure


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


With regards,
Apache Git Services