kyuubi/docs
Fu Chen 393d32a30c
[KYUUBI #3615] Retry opening the engine when encountering a special error
### _Why are the changes needed?_

to close #3615

steps to reproduce

1. start kyuubi server
2. connect to the kyuubi server with client beeline and run query `select 1`
3. force kill the spark application
4. connect to the kyuubi server with another client **A** immediately

```
Error: org.apache.kyuubi.KyuubiSQLException: Error operating LaunchEngine: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
        at org.apache.thrift.transport.TSocket.open(TSocket.java:226)
        at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:266)
        at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
        at org.apache.kyuubi.client.KyuubiSyncThriftClient$.createTProtocol(KyuubiSyncThriftClient.scala:466)
        at org.apache.kyuubi.client.KyuubiSyncThriftClient$.createClient(KyuubiSyncThriftClient.scala:482)
        at org.apache.kyuubi.session.KyuubiSessionImpl.$anonfun$openEngineSession$1(KyuubiSessionImpl.scala:128)
        at org.apache.kyuubi.session.KyuubiSessionImpl.$anonfun$openEngineSession$1$adapted(KyuubiSessionImpl.scala:113)
        at org.apache.kyuubi.ha.client.DiscoveryClientProvider$.withDiscoveryClient(DiscoveryClientProvider.scala:36)
        at org.apache.kyuubi.session.KyuubiSessionImpl.openEngineSession(KyuubiSessionImpl.scala:113)
        at org.apache.kyuubi.operation.LaunchEngine.$anonfun$runInternal$2(LaunchEngine.scala:60)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at org.aache.thrift.transport.TSocket.open(TSocket.java:221)
        ... 14 more (state=,code=0)
```

If the engine exits without calling the shutdown hook, the ZNODE with EPHEMERAL_SEQUENTIAL mode will be deleted upon the client's disconnect, and note that the engine will be marked as disconnected after `kyuubi.zookeeper.embedded.max.session.timeout` (the default value is 1 minutes)

This PR retries opening the engine when encountering a specialty exception (java.net.ConnectException). Before this PR, client **A** will throw an exception, after this PR, client **A** will work properly.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3618 from cfmcgrady/kyuubi-3615.

Closes #3615

96acd66b [Fu Chen] address comment
a1395a60 [Fu Chen] fix style
870216d1 [Fu Chen] Retry opening the engine when encountering a special error

Authored-by: Fu Chen <cfmcgrady@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2022-10-20 14:31:35 +08:00
..
_static/css [KYUUBI #2764] [DOCS] Fix tables in docs being coverd by right toc sidebar 2022-05-27 17:21:42 +08:00
appendix [KYUUBI #2751] [DOC] Replace sphinx_rtd_theme with sphinx_book_theme 2022-05-27 02:22:36 +08:00
changelog [KYUUBI #3342] Add v1.6.0-incubating changelog 2022-08-25 18:00:05 +08:00
client [KYUUBI #3621][DOCS] Add a hint in create batch REST api 2022-10-19 00:25:09 +08:00
community [KYUUBI #3268] Update release docs for status file news 2022-08-18 17:55:13 +08:00
connector [KYUUBI #3531] [FOLLOWUP] Fix malforme format in hive connector doc 2022-10-02 23:49:01 +08:00
deployment [KYUUBI #3615] Retry opening the engine when encountering a special error 2022-10-20 14:31:35 +08:00
develop_tools [KYUUBI #3241][DOCS] Update Develop Tools / Building a Runnable Distribution 2022-08-18 15:38:09 +08:00
extensions [KYUUBI #3601] [SPARK] Support infer columns for rebalance and sort 2022-10-17 18:13:50 +08:00
imgs [KYUUBI #3060] [Subtask][#3059] Build content of the connector document section 2022-07-14 14:19:13 +08:00
monitor [KYUUBI #3157][DOC] Modify logging doc due to using log4j2 instead of log4j 2022-08-15 21:15:56 +08:00
overview [KYUUBI #2751] [DOC] Replace sphinx_rtd_theme with sphinx_book_theme 2022-05-27 02:22:36 +08:00
quick_start [KYUUBI #3423] Bump Flink from 1.15.1 to 1.15.2 2022-09-11 21:30:27 +08:00
security [KYUUBI #3545][KYUUBI #3563] Support restrict spark configurations 2022-09-30 15:43:58 +08:00
tools [KYUUBI #3045][FOLLOWUP] Correct the common options and add docs for kyuubi-admin command 2022-07-15 10:47:49 +08:00
conf.py [KYUUBI #2764] [DOCS] Fix tables in docs being coverd by right toc sidebar 2022-05-27 17:21:42 +08:00
index.rst [KYUUBI #3101] [Subtask][#3100] Build the content for extension points documentation 2022-07-21 15:37:19 +08:00
make.bat
Makefile
requirements.txt [KYUUBI #3126] Using markdown 3.3.7 for kyuubi document build 2022-07-25 14:46:20 +08:00