Skip to content

Commit f97350d

Browse files
cxzl25yaooqinn
authored andcommitted
[KYUUBI #2123] Output engine information after openEngineSession call fails
### _Why are the changes needed?_ #2123 Now after the openEngineSession call fails, there is no engine information output, and it is more difficult to know which engine has the problem in pool mode. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [x] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2124 from cxzl25/KYUUBI-2123. Closes #2123 bc0d90c [sychen] fix style ffa4d77 [sychen] log engine info Authored-by: sychen <sychen@trip.com> Signed-off-by: Kent Yao <yao@apache.org>
1 parent 8c85480 commit f97350d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,17 @@ class KyuubiSessionImpl(
101101
} else {
102102
Option(password).filter(_.nonEmpty).getOrElse("anonymous")
103103
}
104-
_client = KyuubiSyncThriftClient.createClient(user, passwd, host, port, sessionConf)
105-
_engineSessionHandle = _client.openSession(protocol, user, passwd, optimizedConf)
104+
try {
105+
_client = KyuubiSyncThriftClient.createClient(user, passwd, host, port, sessionConf)
106+
_engineSessionHandle = _client.openSession(protocol, user, passwd, optimizedConf)
107+
} catch {
108+
case e: Throwable =>
109+
error(
110+
s"Opening engine [${engine.defaultEngineName} $host:$port]" +
111+
s" for $user session failed",
112+
e)
113+
throw e
114+
}
106115
logSessionInfo(s"Connected to engine [$host:$port] with ${_engineSessionHandle}")
107116
sessionEvent.openedTime = System.currentTimeMillis()
108117
sessionEvent.remoteSessionId = _engineSessionHandle.identifier.toString

0 commit comments

Comments
 (0)