Commit de5c291
v2 executor: pin activity result encode and child run codec to parent run
Two paired drifts surfaced once #330 made avro the default codec:
- ActivityOutcomeRecorder serialized activity results with the package
default (Serializer::serialize) and stamped no codec on the resulting
activity row, so when the workflow side decoded the result via the
run's pinned codec, the bytes did not match the codec — for plain-array
starts the run is json but the result was avro bytes labeled json.
The recorder now uses the parent run's payload_codec to encode results
(and exception payloads) when the worker has not specified one. A
worker-supplied codec still wins (the worker is sending opaque bytes
it serialized itself).
- WorkflowExecutor::startChildWorkflow encoded child arguments with the
parent run codec but stamped the child run with
CodecRegistry::defaultCodec(). When parent and default differ (e.g.
parent is json from a plain-array start and default is avro), the
child run row labels json bytes as avro and the next read fails with
"Failed to base64-decode Avro payload." The child run now inherits
the parent's codec so the bytes and the label agree.
- WorkflowExecutor::activityResult and ::sideEffectResult took an event
with no run context, so they unpacked the result blob with the
codec-blind Serializer::unserialize. Both now accept the active run
and dispatch through the run's pinned codec when available.
Each path falls back to the legacy codec-blind sniffer when the row
has no codec stamped, so pre-pinned history continues to replay.
Part of #331 (thread Avro through every payload surface). Retires the
two server activity- and child-workflow tests that started failing
when avro became the default.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c6f1513 commit de5c291
2 files changed
Lines changed: 61 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
113 | 119 | | |
114 | 120 | | |
115 | | - | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| |||
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
435 | 439 | | |
436 | 440 | | |
437 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
438 | 465 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
| 912 | + | |
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| |||
1426 | 1426 | | |
1427 | 1427 | | |
1428 | 1428 | | |
1429 | | - | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
1430 | 1437 | | |
1431 | 1438 | | |
1432 | 1439 | | |
| |||
1448 | 1455 | | |
1449 | 1456 | | |
1450 | 1457 | | |
1451 | | - | |
| 1458 | + | |
1452 | 1459 | | |
1453 | 1460 | | |
1454 | 1461 | | |
| |||
3120 | 3127 | | |
3121 | 3128 | | |
3122 | 3129 | | |
3123 | | - | |
| 3130 | + | |
3124 | 3131 | | |
3125 | 3132 | | |
3126 | 3133 | | |
3127 | 3134 | | |
3128 | 3135 | | |
3129 | 3136 | | |
3130 | 3137 | | |
3131 | | - | |
| 3138 | + | |
3132 | 3139 | | |
3133 | 3140 | | |
3134 | | - | |
| 3141 | + | |
3135 | 3142 | | |
3136 | 3143 | | |
3137 | 3144 | | |
3138 | 3145 | | |
3139 | 3146 | | |
3140 | 3147 | | |
3141 | 3148 | | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
3142 | 3163 | | |
3143 | 3164 | | |
3144 | 3165 | | |
| |||
0 commit comments