Skip to content

fix: failTimeoutMessages cannot delete outdated messages - #1247

Merged
nodece merged 2 commits into
apache:masterfrom
nodece:fix-sent-at
Jul 22, 2024
Merged

nodece merged 2 commits into
apache:masterfrom
nodece:fix-sent-at

Conversation

@nodece

@nodece nodece commented Jul 12, 2024 •

Copy link
Copy Markdown
Member

Fixes #1236

Motivation

When the producer reconnects to the broker, resending the pending messages, and changing the sentAt, this will break the failTimeoutMessages feature, which compares sentAt with the current time to determine if the message has the timeout.

Modifications

  1. Add createdAt to pendingItem struct.
  2. Init the sentAt and createdAt when sending the message, and update sentAt when resending the message to the broker.

Verifying this change

Use existing tests.

@geniusjoe

geniusjoe commented Jul 16, 2024 •

Copy link
Copy Markdown
Contributor

LGTM. @RobertIndie @crossoverJie Could you review this pr?

Comment thread pulsar/producer_partition.go Resolved
@nodece
nodece requested a review from gunli July 19, 2024 16:30
@RobertIndie RobertIndie added this to the v0.14.0 milestone Jul 22, 2024
@nodece
nodece merged commit a42cc24 into apache:master Jul 22, 2024
@nodece
nodece deleted the fix-sent-at branch July 22, 2024 10:32
RobertIndie pushed a commit that referenced this pull request Jul 31, 2024
* fix: failTimeoutMessages cannot delete outdated messages

* Fix slice pass

(cherry picked from commit a42cc24)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

failTimeoutMessages() cannot delete outdated messages

4 participants