forked from apache/incubator-livy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LIVY-149. Add idle timeout to RSC server.
The RSC server currently listens indefinitely waiting for a Livy server to connect to it. That can result in sessions that never go away and need to be manually cleaned up when the Livy server crashes or is otherwise uncleanly shut down. So add a timeout, default 10 minutes, that allows sessions to shut themselves down if the Livy server goes away and doesn't come back. Closes apache#137
- Loading branch information
Marcelo Vanzin
committed
May 17, 2016
1 parent
386663d
commit 816976f
Showing
5 changed files
with
162 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
test-lib/src/main/java/com/cloudera/livy/test/jobs/Sleeper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to Cloudera, Inc. under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Cloudera, Inc. licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.cloudera.livy.test.jobs; | ||
|
||
import com.cloudera.livy.Job; | ||
import com.cloudera.livy.JobContext; | ||
|
||
public class Sleeper implements Job<Void> { | ||
|
||
private final long millis; | ||
|
||
public Sleeper(long millis) { | ||
this.millis = millis; | ||
} | ||
|
||
@Override | ||
public Void call(JobContext jc) throws Exception { | ||
Thread.sleep(millis); | ||
return null; | ||
} | ||
|
||
} |