[Improvement] Support to show more engine submission failure error for issue tracking
- Dominant language
- Scala
- Stars
- 2.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [X] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
### What would you like to be improved?
Current Kyuubi can recognize the exception information when starting the Engine and return the last Error. However, sometimes the last exception is not the root cause of the Engine start-up. Usually, we need multiple exceptions to determine the fundamental reason for the failure of the engine's launch. Is it possible to return the last several exceptions to better support issue tracking when the engine fails to start? This is an error log from a Spark engine start-up. Kyuubi recognized the exception but was unable to capture the fundamental cause of the engine's failure to start.
```
Caused by: java.lang.RuntimeException: org.apache.kyuubi.KyuubiSQLException:Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
See more: /xxxxxxxxx/kyuubi-spark-sql-engine.log.52
at org.apache.kyuubi.KyuubiSQLException$.apply(KyuubiSQLException.scala:69)
at org.apache.kyuubi.engine.ProcBuilder.$anonfun$start$1(ProcBuilder.scala:142)
... 1 more
```
The root cause log of failure is as follows:
```
23/09/18 09:21:57 INFO SparkContext: Successfully stopped SparkContext
23/09/18 09:21:57 ERROR SparkSQLEngine: Failed to instantiate SparkSession: requirement failed: initial executor number 501 must between min executor number 0 and max executor number 500
java.lang.IllegalArgumentException: requirement failed: initial executor number 501 must between min executor number 0 and max executor number 500
```
### How should we improve?
We could enhance our issue tracking process by defaulting to return multiple exceptions and including the appId in our log entries.
### Are you willing to submit PR?
- [X] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
- [ ] No. I cannot submit a PR at this time.
Contributor guide
Research direction
Start with ProcBuilder.scala and KyuubiSQLException.scala, where engine startup failures and the current last-error handling are referenced. Trace the Spark engine startup path and determine how failure output can include multiple exceptions and the appId; done means the returned tracking information exposes those details for the reported startup failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, spark
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100