New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BATCH] Batch session recovery should start after HTTP server getting started #5310
[BATCH] Batch session recovery should start after HTTP server getting started #5310
Conversation
…overy batch session
@@ -183,7 +191,14 @@ class KyuubiRestFrontendService(override val serverable: Serverable) | |||
if (!isStarted.get) { | |||
try { | |||
server.start() | |||
recoverBatchSessions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will moving it behind startInternal()
solve the issue?
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
Outdated
Show resolved
Hide resolved
…stFrontendService.scala
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
Outdated
Show resolved
Hide resolved
…stFrontendService.scala
Also cc @turboFei |
Codecov Report
@@ Coverage Diff @@
## master #5310 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 590 590
Lines 33372 33376 +4
Branches 4415 4416 +1
======================================
- Misses 33372 33376 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
… server getting started ### _Why are the changes needed?_ In rare cases, when JettyServer is not fully started, we start the recovery task, will get the wrong port. As a result, we cannot get the task that is not properly submitted by the current kyuubi server instance correctly. Like : ``` mysql> select identifier, kyuubi_instance from metadata where kyuubi_instance like '%:-1'; +--------------------------------------+----------------------+ | identifier | kyuubi_instance | +--------------------------------------+----------------------+ | b6e88262-fddb-3ccd-abdf-95ef206e612b | XXXX:-1 | | 6a02b526-ed10-3b76-ba36-d61fbaf6b28d | XXXX:-1 | | 70a0446e-d3d0-3b13-9d34-4cc90369c2d9 | XXXX:-1 | | d290ee2e-b8cd-3bc4-b6c6-72f5b5dfcb9b | XXXX:-1 | | 9bb10f4-24b4-3eec-b13b-7932b310cb5cd | XXXX:-1 | ``` ### _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 In local env, start kyuubi server with this PR, kyuubi server start as excpeted. And i remove start server and runInternal, kyuubi server will wait here. ### _Was this patch authored or co-authored using generative AI tooling?_ No Closes #5310 from zwangsheng/rest_client/wait_server_start_start_recovery. Closes #5310 15282c6 [Cheng Pan] Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala d51476b [Cheng Pan] Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala a276e39 [zwangsheng] remove useless thread 2f91f4c [zwangsheng] fix comment a73fa45 [zwangsheng] [REST] RestService should wait jetty server started then start to recovery batch session Lead-authored-by: zwangsheng <binjieyang@apache.org> Co-authored-by: Cheng Pan <pan3793@gmail.com> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit 18d043f) Signed-off-by: Cheng Pan <chengpan@apache.org>
Thanks, merged to master/1.8 |
Why are the changes needed?
In rare cases, when JettyServer is not fully started, we start the recovery task, will get the wrong port.
As a result, we cannot get the task that is not properly submitted by the current kyuubi server instance correctly.
Like :
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
Run test locally before make a pull request
In local env, start kyuubi server with this PR, kyuubi server start as excpeted.
And i remove start server and runInternal, kyuubi server will wait here.
Was this patch authored or co-authored using generative AI tooling?
No