Show possible error even timeout

This commit is contained in:
Kent Yao 2020-11-16 22:56:25 +08:00
parent 9bd4139453
commit 64b83a48c5
7 changed files with 14 additions and 18 deletions

View File

@ -24,11 +24,11 @@ export KYUUBI_CONF_DIR="${KYUUBI_CONF_DIR:-"${KYUUBI_HOME}"/conf}"
KYUUBI_ENV_SH="${KYUUBI_CONF_DIR}"/kyuubi-env.sh
if [[ -f ${KYUUBI_ENV_SH} ]]; then
set -a
echo "Using kyuubi.sh environment file ${KYUUBI_ENV_SH} to initialize..."
echo "Using kyuubi environment file ${KYUUBI_ENV_SH} to initialize..."
. "${KYUUBI_ENV_SH}"
set +a
else
echo "Warn: Not find kyuubi.sh environment file ${KYUUBI_ENV_SH}, using default ones..."
echo "Warn: Not find kyuubi environment file ${KYUUBI_ENV_SH}, using default ones..."
fi
export KYUUBI_LOG_DIR="${KYUUBI_LOG_DIR:-"${KYUUBI_HOME}/logs"}"

View File

@ -115,13 +115,6 @@ kyuubi\.delegation<br>\.token\.gc\.interval|<div style='width: 80pt;word-wrap: b
kyuubi\.delegation<br>\.token\.max\.lifetime|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT168H</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>unused yet</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.delegation<br>\.token\.renew\.interval|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT168H</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>unused yet</div>|<div style='width: 20pt'>1.0.0</div>
### Engine
Key | Default | Meaning | Since
--- | --- | --- | ---
kyuubi\.engine\.check<br>\.interval|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT10M</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>The check interval for engine timeout</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.engine\.idle<br>\.timeout|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT30M</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>engine timeout, it will be closed when it's not accessed for this duration</div>|<div style='width: 20pt'>1.0.0</div>
### Frontend
Key | Default | Meaning | Since
@ -169,6 +162,8 @@ kyuubi\.operation\.idle<br>\.timeout|<div style='width: 80pt;word-wrap: break-wo
Key | Default | Meaning | Since
--- | --- | --- | ---
kyuubi\.session\.check<br>\.interval|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT5M</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>The check interval for session timeout.</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.session\.engine<br>\.check\.interval|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT10M</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>The check interval for engine timeout</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.session\.engine<br>\.idle\.timeout|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT30M</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>engine timeout, the engine will self-terminate when it's not accessed for this duration</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.session\.engine<br>\.initialize\.timeout|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT1M</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>Timeout for starting the background engine, e.g. SparkSQLEngine.</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.session\.engine<br>\.login\.timeout|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>PT15S</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>The timeout(ms) of creating the connection to remote sql query engine</div>|<div style='width: 20pt'>1.0.0</div>
kyuubi\.session\.engine<br>\.spark\.main\.resource|<div style='width: 80pt;word-wrap: break-word;white-space: normal'>&lt;undefined&gt;</div>|<div style='width: 200pt;word-wrap: break-word;white-space: normal'>The package used to create Spark SQL engine remote application. If it is undefined, Kyuubi will use the default</div>|<div style='width: 20pt'>1.0.0</div>

View File

@ -43,7 +43,7 @@ kyuubi-1.0.0-SNAPSHOT-bin-spark-3.0.1
├── LICENSE
├── RELEASE
├── bin
│   └── kyuubi.sh
│   └── kyuubi
├── conf
│   ├── kyuubi-defaults.conf
│   ├── kyuubi-env.sh
@ -61,7 +61,7 @@ From top to bottom are:
- LICENSE: the [APACHE LICENSE, VERSION 2.0](https://www.apache.org/licenses/LICENSE-2.0) we claim to obey.
- RELEASE: the build information of this package
- bin: the entry of the Kyuubi server w/ `kyuubi.sh` as the startup script.
- bin: the entry of the Kyuubi server w/ `kyuubi` as the startup script.
- conf: all the defaults used by Kyuubi Server itself or creating session with Spark applications.
- externals
- engines: contains all kinds of SQL engines that we support, e.g. Apache Spark, Apache Flink(coming soon).
@ -105,7 +105,7 @@ The `JAVA_HOME` in `$KYUUBI_HOME/conf/kyuubi-env.sh` will take precedence of oth
```bash
bin/kyuubi.sh start
bin/kyuubi start
```
During the server starts, it will print all essential environment variables on the screen, you may check whether they are expected.

View File

@ -19,7 +19,7 @@ This results in the creation of all sub-modules of Kyuubi project w/o running an
If you want to test it manually, you can start Kyuubi directly from the Kyuubi project root by running
```bash
bin/kyuubi.sh start
bin/kyuubi start
```
## Building Submodules Individually

View File

@ -15,7 +15,7 @@ We can configure the JDWP agent in `KYUUBI_JAVA_OPTS` for debugging.
For example,
```bash
KYUUBI_JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 \
bin/kyuubi.sh start
bin/kyuubi start
```
In the IDE, you set the corresponding parameters(host&port) in debug configurations, for example,

View File

@ -365,15 +365,15 @@ object KyuubiConf {
.checkValue(_ > Duration.ofSeconds(3).toMillis, "Minimum 3 seconds")
.createWithDefault(Duration.ofHours(6).toMillis)
val ENGINE_CHECK_INTERVAL: ConfigEntry[Long] = buildConf("engine.check.interval")
val ENGINE_CHECK_INTERVAL: ConfigEntry[Long] = buildConf("session.engine.check.interval")
.doc("The check interval for engine timeout")
.version("1.0.0")
.timeConf
.checkValue(_ > Duration.ofSeconds(3).toMillis, "Minimum 3 seconds")
.createWithDefault(Duration.ofMinutes(10).toMillis)
val ENGINE_IDLE_TIMEOUT: ConfigEntry[Long] = buildConf("engine.idle.timeout")
.doc("engine timeout, it will be closed when it's not accessed for this duration")
val ENGINE_IDLE_TIMEOUT: ConfigEntry[Long] = buildConf("session.engine.idle.timeout")
.doc("engine timeout, the engine will self-terminate when it's not accessed for this duration")
.version("1.0.0")
.timeConf
.createWithDefault(Duration.ofMinutes(30L).toMillis)

View File

@ -99,7 +99,8 @@ class KyuubiSessionImpl(
}
if (started + timeout <= System.currentTimeMillis()) {
process.destroyForcibly()
throw KyuubiSQLException(s"Timed out($timeout ms) to launched Spark with $builder")
throw KyuubiSQLException(s"Timed out($timeout ms) to launched Spark with $builder",
builder.getError)
}
sh = getServerHost
}