This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new ece25f2b5 [KYUUBI #5305] Return dummy log when batch job before being
added to session manager
ece25f2b5 is described below
commit ece25f2b5dbcd6790b023a20c1d2fe1a79d761c0
Author: zwangsheng <[email protected]>
AuthorDate: Mon Sep 18 18:29:20 2023 +0800
[KYUUBI #5305] Return dummy log when batch job before being added to
session manager
…sion manager
### _Why are the changes needed?_
As title
Current we open session first then hand this session with batch by
SessionManager:
https://github.com/apache/kyuubi/blob/413683507079f8f97217e8099177f0b16bc9192d/kyuubi-common/src/main/scala/org/apache/kyuubi/session/SessionManager.scala#L97-L121
We may face `No local log `exception, when kyuubi server picked this batch
job to open session but not handled by SessionManager, due to time gap and code
gap.
### _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 #5305 from zwangsheng/server/improve_localLog_when_job_under_submmit.
Closes #5305
14e27c115 [Cheng Pan] Update
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
a5b3ca1f0 [zwangsheng] [V2] Retunr dump log when batch job was picked but
not handler by session manager
Lead-authored-by: zwangsheng <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
.../scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala | 7 +++++++
1 file changed, 7 insertions(+)
diff --git
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
index 12db68aeb..a525ac4b2 100644
---
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
+++
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
@@ -415,6 +415,13 @@ private[v1] class BatchesResource extends
ApiRequestContext with Logging {
} else if (fe.connectionUrl != metadata.kyuubiInstance) {
val internalRestClient =
getInternalRestClient(metadata.kyuubiInstance)
internalRestClient.getBatchLocalLog(userName, batchId, from, size)
+ } else if (batchV2Enabled(metadata.requestConf) &&
+ // in batch v2 impl, the operation state is changed from PENDING to
RUNNING
+ // before being added to SessionManager.
+ (metadata.state == "PENDING" || metadata.state == "RUNNING")) {
+ info(s"Batch $batchId is waiting for submitting")
+ val dummyLogs = List(s"Batch $batchId is waiting for
submitting").asJava
+ new OperationLog(dummyLogs, dummyLogs.size)
} else {
throw new NotFoundException(s"No local log found for batch:
$batchId")
}