SIGN IN SIGN UP
apache / airflow UNCLAIMED

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows

0 0 267 Python

Go-SDK: Add coordinator-mode protocol primitives and SDK surface hooks (#67315)

* go-sdk: Add coordinator-mode protocol primitives and SDK surface hooks

First step toward landing the Go SDK coordinator-mode runtime
(ADR 0003, msgpack-over-IPC). Scaffolding only -- no entry point is wired
here, so go-plugin / Edge Worker behaviour is unchanged.

Adds the length-prefixed msgpack frame codec and the typed message
envelopes the runtime will exchange with the supervisor, the
sdkcontext.SdkClientContextKey injection hook on bundlev1.Task so a
follow-up PR can swap in a comm-socket-backed sdk.Client, and the small
sdk surface tweaks (ConnFromAPIResponse export, VariableClient interface
docs, secret-masking TODOs) the comm-socket client will rely on. Pulls
in github.com/vmihailenco/msgpack/v5 -- the encoding the supervisor
speaks.

* Fix: Update max frame size constant and enhance payload validation

* Fix: Tighten coordinator-protocol message decoding

- Add strict mapInt for required fields; require try_number on
  StartupDetails so supervisor/runtime version-drift surfaces as a
  decode error instead of a silent default.
- Use RFC3339Nano for SucceedTask and TaskState end_date so the
  sub-second precision asTime parses round-trips on the wire.
- Change SetXComMsg.MapIndex to *int and omit when nil, matching
  Python's SetXCom.map_index = None semantics and GetXComMsg.MapIndex.

* Add regression test for writeFrame oversize-payload guard

Pins the guard at the top of writeFrame so a future refactor cannot
silently drop the uint32-overflow protection. Uses unsafe.Slice to build
a fake-length payload without allocating multi-GiB buffers, since the
guard only reads len(payload) before any allocation or byte access.

The matching read-side guard in readFrame is dead code with MaxFrameSize
pinned at the uint32 maximum and cannot be exercised without modifying
production code; documented inline.
J
Jason(Zhe-You) Liu committed
129d03ed7a94f55d69f3040c5111dda2980b9ae1
Parent: 9f5ee0f
Committed by GitHub <noreply@github.com> on 5/27/2026, 5:05:04 AM