Commit 2aecce9
Fix child workflow codec mismatch when args contain PHP-only values
`async()` produces a `SerializableClosure` which Avro cannot round-trip.
The child run inherits the parent's `payload_codec` but `serializeWithCodec`
silently serialized the closure-carrying array as zero-length Avro bytes,
so on child start the codec tag said "avro" while the blob was empty/invalid
— the v2 engine failed the run with `CodecDecodeException`.
Same pattern as `a71304a` (legacy `__callStatic` path) extended to the
explicit-codec `serializeWithCodec` path:
- Serializer: new `chooseCodecForData(?preferred, data): string` helper that
falls back to `workflow-serializer-y` when Avro is preferred but the data
carries PHP-only objects. Callers that stamp `payload_codec` alongside a
blob must use this helper so the row's codec tag matches the bytes.
- WorkflowExecutor::scheduleChildWorkflow: pick the child run's codec via
the helper before serializing, so `workflow_runs.payload_codec` reflects
the actual wire format.
- WorkflowExecutor::recordWorkflowStartCommand: same treatment for the
`workflow_commands.payload_codec` column.
Also fill in missing columns in the V2ConfiguredCoreModelsTest custom
tables (`search_attributes`, `namespace`, `message_cursor_position`,
`run_timeout_seconds`, `execution_deadline_at`, `run_deadline_at`, plus
new `namespace`/`execution_timeout_seconds`/`last_message_sequence` on the
instance-alias table and `namespace` on the task-alias table) so the
test's alias models accept every column the v2 engine writes.
Clears five MySQL failures on workflow v2 CI under #399:
* testCoreRuntimeUsesConfiguredInstanceRunAndTaskModels
* testAsyncHelperRunsStraightLineClosureAsDurableChildWorkflow
* and three related cascading failures that depended on async child
workflows completing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 26c587b commit 2aecce9
3 files changed
Lines changed: 53 additions & 3 deletions
File tree
- src
- Serializers
- V2/Support
- tests/Feature/V2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
129 | 148 | | |
130 | 149 | | |
131 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
1518 | | - | |
| 1518 | + | |
1519 | 1519 | | |
1520 | 1520 | | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1521 | 1526 | | |
1522 | 1527 | | |
1523 | 1528 | | |
| |||
2499 | 2504 | | |
2500 | 2505 | | |
2501 | 2506 | | |
2502 | | - | |
2503 | | - | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
2504 | 2512 | | |
2505 | 2513 | | |
2506 | 2514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| 96 | + | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
| 125 | + | |
| 126 | + | |
115 | 127 | | |
116 | 128 | | |
117 | 129 | | |
| |||
131 | 143 | | |
132 | 144 | | |
133 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
134 | 154 | | |
135 | 155 | | |
136 | 156 | | |
| |||
156 | 176 | | |
157 | 177 | | |
158 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
159 | 182 | | |
160 | 183 | | |
161 | 184 | | |
| |||
0 commit comments