You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@livy.apache.org by gg...@apache.org on 2023/04/12 07:56:46 UTC
[incubator-livy] branch master updated: [LIVY-973][RSC] Always close RSCClient's EventLoopGroup (#398)
This is an automated email from the ASF dual-hosted git repository.
ggal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-livy.git
The following commit(s) were added to refs/heads/master by this push:
new 830a27e1 [LIVY-973][RSC] Always close RSCClient's EventLoopGroup (#398)
830a27e1 is described below
commit 830a27e16efa9d1e6265988d7d71dc1de6ed2b39
Author: RajshekharMuchandi <rs...@gmail.com>
AuthorDate: Wed Apr 12 13:26:39 2023 +0530
[LIVY-973][RSC] Always close RSCClient's EventLoopGroup (#398)
## What changes were proposed in this pull request?
Added try-catch block to jobs' setFailure() and log entries if there is any exception. eventLoopGroup.shutdownGracefully(); statement will be executed after exception is caught.
---
rsc/src/main/java/org/apache/livy/rsc/RSCClient.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/rsc/src/main/java/org/apache/livy/rsc/RSCClient.java b/rsc/src/main/java/org/apache/livy/rsc/RSCClient.java
index c1c95340..ee9c9012 100644
--- a/rsc/src/main/java/org/apache/livy/rsc/RSCClient.java
+++ b/rsc/src/main/java/org/apache/livy/rsc/RSCClient.java
@@ -241,7 +241,11 @@ public class RSCClient implements LivyClient {
// Report failure for all pending jobs, so that clients can react.
for (Map.Entry<String, JobHandleImpl<?>> e : jobs.entrySet()) {
LOG.info("Failing pending job {} due to shutdown.", e.getKey());
- e.getValue().setFailure(new IOException("RSCClient instance stopped."));
+ try {
+ e.getValue().setFailure(new IOException("RSCClient instance stopped."));
+ } catch (Exception e2) {
+ LOG.info("Job " + e.getKey() + " already failed.", e2);
+ }
}
eventLoopGroup.shutdownGracefully();