henry3260 opened a new pull request, #73820:
URL: https://github.com/apache/airflow/pull/73820

   ## Why
   
   `SocketLogHandler.Handle` builds one map per log line and writes the four 
standard
   fields into it. `event` and `timestamp` went in *before* the user 
attributes, so a
   user attribute of the same name overwrote them. `level` and `logger` went in
   *after* the attributes and were unaffected.
   
   `event` carries the message. The supervisor reads a task's log line out of 
that key
   (`msg = event.pop("event", None)`), so a Dag logging an attribute called 
`event`
   lost its message entirely, with nothing left in the emitted line to show 
that a
   message had ever existed:
   
   ```
   before   
{"event":"row_batch_done","level":"info","timestamp":"2026-09-28T00:55:22..."}
   after    {"event":"loaded 42 
rows","level":"info","timestamp":"2026-09-28T13:02:15..."}
   ```
   
   A displaced `timestamp` leaves the supervisor a value its `msgspec` datetime 
decode
   cannot parse, on a path outside the `try`/`except` that guards malformed log 
lines.
   
   ## What
   
   - `go-sdk/pkg/execution/logger.go` — `event` and `timestamp` now go in after 
the
     attribute loops, next to `level` and `logger`. The `!r.Time.IsZero()` 
guard on
     `timestamp` is unchanged: a record with no time is not something the SDK
     produces, and widening that guard would be a separate behaviour change.
   - `go-sdk/pkg/execution/logger_test.go` —
     `TestSocketLogHandlerEventAndTimestampOverrideAttrs` extends the rule that
     `TestSocketLogHandlerStandardFieldsOverrideAttrs` already pins for `level` 
and
     `logger`. Both subtests fail without the fix.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to