Skip to content

Commit

Permalink
[KYUUBI #5499][KYUUBI #2503] Catch any exception when closing idle se…
Browse files Browse the repository at this point in the history
…ssion

### _Why are the changes needed?_

Now only the KyuubiSQLException is caught when closing idle session, we wonder some exception is not caught and cause the session timeout checkTask exit.
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No.

Closes #5515 from turboFei/catch_check_task.

Closes #5499

Closes #2503

8612488 [fwang12] nonfatal
d4dbbfa [fwang12] catch exception

Authored-by: fwang12 <fwang12@ebay.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
  • Loading branch information
turboFei authored and davidyuan1223 committed Oct 26, 2023
1 parent b7b3544 commit dfdd7a3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import java.util.concurrent.{ConcurrentHashMap, Future, ThreadPoolExecutor, Time

import scala.collection.JavaConverters._
import scala.concurrent.duration.Duration
import scala.util.control.NonFatal

import org.apache.hive.service.rpc.thrift.TProtocolVersion

Expand Down Expand Up @@ -312,8 +313,7 @@ abstract class SessionManager(name: String) extends CompositeService(name) {
try {
closeSession(session.handle)
} catch {
case e: KyuubiSQLException =>
warn(s"Error closing idle session ${session.handle}", e)
case NonFatal(e) => warn(s"Error closing idle session ${session.handle}", e)
}
} else {
session.closeExpiredOperations()
Expand Down

0 comments on commit dfdd7a3

Please sign in to comment.