Commit 810bfee
[fix][fn] Honour negativeAckRedeliveryDelayMs in the Python function runtime
The Python runtime negatively acknowledges on failure but never configured
the redelivery delay, so the client default of 60 seconds applied
regardless of what SourceSpec.negativeAckRedeliveryDelayMs carried. A
function configured for fast retry, or for a long back-off from a
struggling downstream, silently got neither.
Add get_negative_ack_args() and splat its result into all three
subscribe() call sites.
Two details drive the shape:
- The field is a proto3 scalar with no presence, so an unset value reads
as 0. Only a positive value is forwarded, leaving the client default in
place otherwise - the same guard JavaInstanceRunnable applies. Sending 0
through would mean immediate redelivery rather than the default.
- The argument is omitted rather than passed as None. subscribe()
validates it with _check_type(int, ...) and not _check_type_or_none, so
None would raise for every function that does not configure it, unlike
the neighbouring unacked_messages_timeout_ms which does accept None.
Returning a dict to splat rather than a value keeps that omission at one
site, since the first call site passes explicit keywords while the other
two build a consumer_args dict.
Fixes #26411
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 3be684a commit 810bfee
2 files changed
Lines changed: 61 additions & 1 deletion
File tree
- pulsar-functions/instance/src
- main/python
- test/python
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | | - | |
| 186 | + | |
| 187 | + | |
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| |||
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
| 213 | + | |
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
| |||
584 | 588 | | |
585 | 589 | | |
586 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
587 | 611 | | |
588 | 612 | | |
589 | 613 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
0 commit comments