Skip to content

[bug][CGS][engineconn] fix sr task retry causing init_sql loading exception #5392

Closed

Description

@v-kkhuang

Search before asking

  • I had searched in the issues and found no similar issues.

Linkis Component

  • linkis-commons
  • 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?

  • Yes I am willing to submit a PR!

Activity

  1. github-actions commented on Mar 27, 2026

    @github-actions

    😊 Welcome to the Apache Linkis community!!

    We are glad that you are contributing by opening this issue.

    Please make sure to include all the relevant context.
    We will be here shortly.

    If you are interested in contributing to our website project, please let us know!
    You can check out our contributing guide on
    👉 How to Participate in Project Contribution.

    Community

    WeChat Assistant WeChat Public Account

    Mailing Lists

    Name Description Subscribe Unsubscribe Archive
    dev@linkis.apache.org community activity information subscribe unsubscribe archive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions