Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import java.util.Base64

import org.apache.hadoop.conf.Configuration

import org.apache.kyuubi.KyuubiSQLException
import org.apache.kyuubi.{KyuubiException, KyuubiSQLException}
import org.apache.kyuubi.cli.Handle
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.config.KyuubiConf.KYUUBI_SERVER_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE
import org.apache.kyuubi.config.KyuubiReservedKeys._
import org.apache.kyuubi.events.EventBus
import org.apache.kyuubi.ha.client.{KyuubiServiceDiscovery, ServiceDiscovery}
import org.apache.kyuubi.metrics.MetricsConstants._
import org.apache.kyuubi.metrics.MetricsSystem
Expand Down Expand Up @@ -69,6 +70,17 @@ final class KyuubiTBinaryFrontendService(
serverContext: ServerContext,
input: TProtocol,
output: TProtocol): Unit = {
val handle = serverContext.getSessionHandle
if (handle != null) {
be.sessionManager
.getSessionOption(handle)
.map(_.asInstanceOf[KyuubiSessionImpl])
.flatMap(_.getSessionEvent).foreach { sessionEvent =>
sessionEvent.exception = Some(new KyuubiException(
s"Session between client and Kyuubi server disconnected without closing properly."))
EventBus.post(sessionEvent)
Comment thread
turboFei marked this conversation as resolved.
Outdated
}
}
super.deleteContext(serverContext, input, output)
MetricsSystem.tracing { ms =>
ms.decCount(THRIFT_BINARY_CONN_OPEN)
Expand Down