fix: support connectrpc 0.11 property-form request_headers (FLYTE-SDK-5T)#1253
Open
EngHabu wants to merge 1 commit into
Open
fix: support connectrpc 0.11 property-form request_headers (FLYTE-SDK-5T)#1253EngHabu wants to merge 1 commit into
EngHabu wants to merge 1 commit into
Conversation
pingsutw
reviewed
Jun 25, 2026
|
|
||
| async def on_start(self, ctx) -> None: | ||
| existing_rid = ctx.request_headers().get("x-request-id") | ||
| headers = request_headers(ctx) |
Member
There was a problem hiding this comment.
related to https://unionai.slack.com/archives/C07QTRXMH8C/p1782404943001369. connect rpc just fixed this breaking change today, we will bump the version next week
4e496ea to
372a020
Compare
connectrpc 0.11 turned RequestContext.request_headers (and the other accessors) from methods into @Property attributes. Our auth interceptors called ctx.request_headers() as a method, so users who resolved connectrpc>=0.11 (allowed by the connectrpc>=0.9.0,<1.0.0 pin) crashed with "TypeError: 'Headers' object is not callable" on every control-plane RPC (SelectCluster, uploads, runs). Add a small _compat.request_headers(ctx) accessor that resolves both the method form (connectrpc <0.11) and the property form (>=0.11), and route the four interceptor call sites through it. Adds tests covering both API shapes. fixes FLYTE-SDK-5T Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
372a020 to
e8b8310
Compare
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 (FLYTE-SDK-5T)
connectrpc 0.11 changed
RequestContext.request_headers(and the other accessors) from methods into@propertyattributes. Our auth interceptors callctx.request_headers()as a method, so any user who resolvedconnectrpc>=0.11— which is permitted by ourconnectrpc>=0.9.0,<1.0.0pin — crashes with:Because the failure is in the metadata/auth interceptor that runs on every outgoing control-plane RPC, the user can't
SelectCluster, upload, or run anything — it surfaces in Sentry asRuntimeSystemError: Upload failed ... SelectCluster failed. Seen on the latest release 2.5.4.Fix
Add a tiny
_compat.request_headers(ctx)accessor that resolves both API shapes:<0.11:request_headersis a bound method → callable → invoked.>=0.11:request_headersis aHeadersproperty → not callable → used directly.All four interceptor call sites (
default_metadata.py×2,auth.py×2) now route through it. This keeps the SDK working across the entire pinned connectrpc range rather than betting on one API shape.Tests
tests/flyte/remote/test_connectrpc_interceptors.py:TestRequestHeadersCompat— unit tests for both method-form and property-form contexts.TestConnectrpc011PropertyForm— DefaultMetadata + Auth interceptors against a property-form context (regression guard for 5T).47/47 pass locally.
fixes FLYTE-SDK-5T