Skip to content

[improve][doc] Note that --timeout-ms also sets the negative ack redelivery delay - #1216

Merged
david-streamlio merged 2 commits into
apache:mainfrom
david-streamlio:docs-fn-timeout-ms-nack
Aug 25, 2026
Merged

[improve][doc] Note that --timeout-ms also sets the negative ack redelivery delay#1216
david-streamlio merged 2 commits into
apache:mainfrom
david-streamlio:docs-fn-timeout-ms-nack

Conversation

@david-streamlio

@david-streamlio david-streamlio commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

FunctionConfigUtils.convert sets a function's negative-ack redelivery delay from its message timeout:

if (functionConfig.getTimeoutMs() != null) {
    sourceSpec.setTimeoutMs(functionConfig.getTimeoutMs());
    // We use negative acks for fast tracking failures
    sourceSpec.setNegativeAckRedeliveryDelayMs(functionConfig.getTimeoutMs());
}

So --timeout-ms silently drives two settings: the unacknowledged-message timeout and the delay before a negatively acknowledged message is redelivered.

Nothing in the docs says so. The timeoutMs row documents only the message timeout, and negativeAckRedeliveryDelayMs is not a function-level option at all — there is no FunctionConfig field and no flag in CmdFunctions. The sink equivalent, --negative-ack-redelivery-delay-ms, is documented in io-cli.md, which makes the absence for functions look like an oversight rather than a deliberate coupling.

The practical effect: someone lowering --timeout-ms to fail fast also shortens redelivery, and someone raising it for a slow downstream also delays every retry. Neither is discoverable from the current description.

Modifications

Amend the timeoutMs row to state the coupling, and record how the three runtimes differ:

Runtime Message timeout Negative-ack redelivery delay
Java yes yes
Python yes no (#26411)
Go no yes
  • JavaPulsarSource calls both ackTimeout(...) and negativeAckRedeliveryDelay(...).
  • Pythonpython_instance.py passes unacked_messages_timeout_ms but never the redelivery delay, so the client default of 60 s always applies.
  • Goinstance.go builds ConsumerOptions with NackRedeliveryDelay and no ack timeout.

Versioned docs

The coupling is present in every supported release, so docs/ plus 5.0.x, 4.2.x, and 4.0.x.

The runtime line there is not a copy of the one in docs/. apache/pulsar#26415 gave the Go runtime the negative-ack redelivery delay on master only, and it is in none of these releases; the Go runtime has never applied an ack timeout either, its ConsumerOptions carrying neither field. So the versioned copies say Go applies neither setting, where docs/ says it applies the redelivery delay.

Follow-up

apache/pulsar#26413 makes the Python runtime honour the redelivery delay. When it lands, the Python entry becomes "yes" and the #26411 reference comes out — a one-line change I will send separately rather than describing behaviour that has not shipped.

I have deliberately left that PR labelled doc-not-needed. The gap documented here predates it and is equally true of Java today, so it seemed wrong to make an unrelated fix carry it.

Documentation

This is the documentation change.

…livery delay

FunctionConfigUtils.convert sets sourceSpec.negativeAckRedeliveryDelayMs from
functionConfig.getTimeoutMs(), so a function's --timeout-ms silently drives two
settings: the unacknowledged-message timeout and the redelivery delay applied to
negatively acknowledged messages.

Nothing says so. The timeoutMs row documents only the message timeout, and
negativeAckRedeliveryDelayMs is not a function-level option at all -- there is no
FunctionConfig field and no flag in CmdFunctions, so the sink equivalent
(--negative-ack-redelivery-delay-ms, documented in io-cli.md) has no counterpart
here. A user tuning --timeout-ms has no way to learn that redelivery timing moves
with it.

The three runtimes also differ, which the row now records: Java applies both,
Python applies the message timeout only (#26411), and Go applies the redelivery
delay only -- its ConsumerOptions sets NackRedeliveryDelay and no ack timeout.
… docs

The contribution guide asks that a documentation change applying to a supported
version update versioned_docs alongside docs/. The coupling this note describes
is present in every supported release: 5.0.x, 4.2.x, and 4.0.x.

The runtime line differs from docs/ and is not a straight copy. #26415 gave the
Go runtime the negative-ack redelivery delay on master only, and it is in none of
these releases; the Go runtime has never applied an ack timeout either, its
ConsumerOptions carrying neither field. So Go applies *neither* setting in the
released versions, where master will soon apply one.
@david-streamlio
david-streamlio merged commit 2cd8016 into apache:main Aug 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant