Skip to content

Fix ClassCastException in FlightClientChannel for large requests#20010

Merged
jainankitk merged 1 commit intoopensearch-project:mainfrom
rishabhmaurya:fix-flight-classcast
Nov 15, 2025
Merged

Fix ClassCastException in FlightClientChannel for large requests#20010
jainankitk merged 1 commit intoopensearch-project:mainfrom
rishabhmaurya:fix-flight-classcast

Conversation

@rishabhmaurya
Copy link
Contributor

@rishabhmaurya rishabhmaurya commented Nov 15, 2025

Replace unsafe BytesArray cast with BytesReference.toBytes()

Description

serializeToTicket() casts BytesReference to BytesArray, failing for requests >16KB which use PagedBytesReference -

  1> Caused by: java.lang.ClassCastException: class org.opensearch.core.common.bytes.PagedBytesReference cannot be cast to class org.opensearch.core.common.bytes.BytesArray (org.opensearch.core.common.bytes.PagedBytesReference and org.opensearch.core.common.bytes.BytesArray are in unnamed module of loader 'app')
  1>    at org.opensearch.arrow.flight.transport.FlightClientChannel.serializeToTicket(FlightClientChannel.java:354) ~[main/:?]

Fix: Replace unsafe BytesArray cast with BytesReference.toBytes()

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
    - [ ] API changes companion pull request created, if applicable.
    - [ ] Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Replace unsafe BytesArray cast with BytesReference.toBytes()

Signed-off-by: Rishabh Maurya <[email protected]>
@rishabhmaurya rishabhmaurya marked this pull request as ready for review November 15, 2025 02:15
@rishabhmaurya rishabhmaurya requested a review from a team as a code owner November 15, 2025 02:15
@github-actions
Copy link
Contributor

✅ Gradle check result for 1b49220: SUCCESS

@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.24%. Comparing base (5969a77) to head (1b49220).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20010      +/-   ##
============================================
- Coverage     73.30%   73.24%   -0.07%     
- Complexity    71635    71642       +7     
============================================
  Files          5789     5789              
  Lines        327204   327203       -1     
  Branches      47296    47296              
============================================
- Hits         239870   239663     -207     
- Misses        68113    68351     +238     
+ Partials      19221    19189      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Performance Roadmap Nov 15, 2025
@jainankitk jainankitk merged commit cdc40c5 into opensearch-project:main Nov 15, 2025
36 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Performance Roadmap Nov 15, 2025
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 15, 2025
)

Replace unsafe BytesArray cast with BytesReference.toBytes()

Signed-off-by: Rishabh Maurya <[email protected]>
(cherry picked from commit cdc40c5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
rgsriram pushed a commit to rgsriram/OpenSearch that referenced this pull request Dec 5, 2025
…nsearch-project#20010)

Replace unsafe BytesArray cast with BytesReference.toBytes()

Signed-off-by: Rishabh Maurya <[email protected]>
liuguoqingfz pushed a commit to liuguoqingfz/OpenSearch that referenced this pull request Dec 15, 2025
…nsearch-project#20010)

Replace unsafe BytesArray cast with BytesReference.toBytes()

Signed-off-by: Rishabh Maurya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 3.3 Backport to 3.3 branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants