You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "88fantasy (via GitHub)" <gi...@apache.org> on 2026/08/12 23:12:57 UTC

[PR] [Flink] Fix shims classloader isolation and result serialization for Flink SQL verify [streampark]

88fantasy opened a new pull request, #4484:
URL: https://github.com/apache/streampark/pull/4484

   ## What changes were proposed in this pull request
   
   Issue Number: close #4479
   
   Fixes two chained bugs that make `POST /flink/sql/verify` fail for every Flink version on `dev`:
   
   1. `FlinkShimsProxy#matchShimIncludeReason()` never matched `streampark-flink-shims-base-*.jar`, so `FlinkSqlValidator` fell back to loading via the console's own `AppClassLoader` (no Calcite on its classpath) instead of the intended per-Flink-version `ChildFirstClassLoader`, causing `NoClassDefFoundError: org/apache/calcite/sql/validate/SqlConformance`.
   2. `FlinkSqlValidationResult` never implemented `Serializable`, so once (1) is fixed, `FlinkShimsProxy#getObject()`'s cross-classloader `ObjectOutputStream` marshaling fails with `NotSerializableException` on every successful validation.
   
   Both are regressions from #4461 (Scala→Java shims migration), which moved these classes into the newly split-out `streampark-flink-shims-base` module without preserving the classloader-inclusion behavior or `Serializable` semantics the Scala code had.
   
   ## Brief change log
   
   - Add a `streampark-flink-shims-base` prefix match to `FlinkShimsProxy#matchShimIncludeReason()`, alongside the existing `streampark-flink-shims_flink<version>` match, so the base module loads child-first through the same per-version classloader that already resolves `flink-table-planner` from `$FLINK_HOME/lib`/`opt`.
   - Add `implements Serializable` (+ `serialVersionUID`) to `FlinkSqlValidationResult`. All fields are `boolean`/`int`/`String`/enum, so this is a plain marker-interface change with a stable field layout.
   
   ## Verifying this change
   
   Manually verified against a real Flink 2.2.1 standalone cluster (official binary distribution — `opt/flink-table-planner_2.12-2.2.1.jar` present, per the documented 1.15+ `table-planner-loader` isolation mechanism):
   
   - Before this change: `POST /flink/sql/verify` against a batch `datagen → print` SQL statement fails 3/3 times with `NoClassDefFoundError: org/apache/calcite/sql/validate/SqlConformance` (reproduced against the unmodified `dev` build).
   - After fix (1) alone: the `NoClassDefFoundError` is gone; verification now fails with `NotSerializableException: org.apache.streampark.flink.core.FlinkSqlValidationResult`.
   - After both fixes: `POST /flink/sql/verify` against the same SQL statement returns `{"status":"success","code":"200","data":true}`.
   
   `./mvnw -pl streampark-flink/streampark-flink-proxy,streampark-flink/streampark-flink-shims/streampark-flink-shims-base clean compile checkstyle:check spotless:check` passes with 0 violations.
   
   ## Does this pull request potentially affect one of the following parts
   
   - Dependencies (does it add or upgrade a dependency): no
   - Anything that affects deployment: no
   - The persistence of application state: no
   - The direction of network connections: no
   - Anything that affects any api: no (fixes a broken existing API endpoint, no signature/contract change)
   


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Flink] Fix shims classloader isolation and result serialization for Flink SQL verify [streampark]

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys merged PR #4484:
URL: https://github.com/apache/streampark/pull/4484


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Flink] Fix shims classloader isolation and result serialization for Flink SQL verify [streampark]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4484:
URL: https://github.com/apache/streampark/pull/4484#issuecomment-5273892862

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=4484) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=4484&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=4484&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=4484&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=4484&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=4484&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=4484)
   
   


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org