fix: Use do_exchange for offline server reads to support HPA - #6846
Merged
ntkathole merged 1 commit intoSep 21, 2026
Merged
Conversation
The remote offline server used a two-phase Arrow Flight protocol for read operations: do_put (stores entity data in an in-memory dict) followed by get_flight_info + do_get (retrieves results). With HPA or multiple replicas, these separate gRPC calls can be load-balanced to different pods, causing 'Flight not found' errors because the in-memory flights dict is per-pod. Replace the two-phase read path with Arrow Flight's do_exchange RPC, which handles both the upload and result download in a single bidirectional gRPC stream. This guarantees both phases hit the same pod, making the offline server compatible with horizontal scaling. Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
ntkathole
force-pushed
the
fix/offline-server-do-exchange-hpa
branch
from
September 18, 2026 06:52
8a44a0f to
48ad47c
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6846 +/- ##
==========================================
+ Coverage 47.43% 47.48% +0.05%
==========================================
Files 422 422
Lines 52263 52321 +58
Branches 7582 7590 +8
==========================================
+ Hits 24791 24846 +55
+ Misses 25708 25702 -6
- Partials 1764 1773 +9
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Marcus-Rosti
approved these changes
Sep 18, 2026
Marcus-Rosti
left a comment
Contributor
There was a problem hiding this comment.
I'll try testing this, but overall the logic looks right for the flight server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The remote offline server uses a two-phase Arrow Flight protocol for read operations:
do_put— client sends command + entity data → server stores it inself.flights(an in-memory Python dict)get_flight_info+do_get— client retrieves results in separate gRPC calls → server looks upself.flightsWith HPA (Horizontal Pod Autoscaler) or multiple replicas, these separate gRPC calls can be load-balanced to different pods. When
do_putlands on Pod A butget_flight_infohits Pod B, the server raisesKeyError("Flight not found.")because Pod B'sself.flightsdict has no record of the flight stored on Pod A.Solution
Replace the two-phase read path with Arrow Flight's
do_exchangeRPC, which handles both the entity data upload and result download in a single bidirectional gRPC stream. This guarantees both phases are processed by the same server pod.