Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: failTimeoutMessages cannot delete outdated messages #1247

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

nodece
Copy link
Member

@nodece nodece commented Jul 12, 2024

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
Copy link
Contributor

geniusjoe commented Jul 16, 2024

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

pulsar/producer_partition.go Outdated Show resolved Hide resolved
@RobertIndie RobertIndie added this to the v0.14.0 milestone Jul 22, 2024
@nodece nodece merged commit a42cc24 into apache:master Jul 22, 2024
9 checks passed
@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