Skip to content

[Go Functions] negativeAckRedeliveryDelayMs is ignored, so the client default always applies #26409

Description

@david-streamlio

Master Issue: #26404

Search before reporting

  • I searched in the issues and found nothing similar.

Motivation

SourceSpec.negativeAckRedeliveryDelayMs sets how long the broker waits before redelivering a negatively acknowledged message. The Go runtime negatively acknowledges on failure:

// pulsar-function-go/pf/instance.go:389-397
func (gi *goInstance) shouldNackInputOnFailure() bool {
...
	if gi.shouldNackInputOnFailure() {

but never configures the delay — git grep -in "NegativeAck" -- 'pulsar-function-go/pf/*.go' finds no NackRedeliveryDelay on the consumer options, so the client default (1 minute) always applies.

A function configured with a short redelivery delay for fast retry, or a long one to back off from a struggling downstream, gets neither. The value is accepted and silently replaced by the default.

The Python runtime has the same gap, tracked separately for that runtime. The Java runtime applies it.

Solution

Set NackRedeliveryDelay on the pulsar.ConsumerOptions in setupConsumer when funcDetails.Source.NegativeAckRedeliveryDelayMs > 0, leaving the client default when unset.

The > 0 guard matters: the field is a proto3 scalar with no presence, so zero is indistinguishable from unset, and passing zero through would mean immediate redelivery rather than the default. Java guards the same way (if (sourceSpec.getNegativeAckRedeliveryDelayMs() > 0) in JavaInstanceRunnable).

Alternatives

None. This is a one-line addition to the consumer options with a guard.

Anything else?

Verified against origin/master.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/functiontype/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions