v-kkhuang opened a new issue, #5392: URL: https://github.com/apache/linkis/issues/5392
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/linkis/issues) and found no similar issues. ### Linkis Component - [ ] linkis-commons - [x] linkis-computation-governance - [ ] linkis-dist - [ ] linkis-engineconn-plugin - [ ] linkis-extensions - [ ] linkis-orchestrator - [ ] linkis-public-enhancements - [ ] linkis-spring-cloud-services - [ ] linkis-web ### Description When SR (Script) tasks are retried, the init_sql loading process causes an exception due to null pointer exception when accessing the EngineTypeLabel. The method `adjustErrorIndexForSetScenarios` uses `find().get` which throws NoSuchElementException when the label is not present. ### Steps to reproduce 1. Execute an SR task with init_sql configuration 2. Trigger a task retry scenario 3. The system throws an exception when trying to access EngineTypeLabel ### Expected behavior The system should handle the case when EngineTypeLabel is not present gracefully and continue execution without throwing exceptions. ### Your environment - Linkis version used: 1.18.0 - Environment name and version: - hadoop-3.3.4 - hive-2.3.3 - spark-2.4.3/3.3.0 - scala-2.11.12/2.12.17 - jdk 1.8.0_xxx ### Anything else The fix uses `collectFirst` instead of `find().get` to safely handle the case when EngineTypeLabel is not present, and adds null check for executionCode. ### Are you willing to submit a PR? - [x] Yes I am willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
