Coder Social home page Coder Social logo

Comments (13)

merlimat avatar merlimat commented on July 19, 2024

I'm going to be out for the next few days. @rdhabalia can you take a look at this?

from pulsar.

sschepens avatar sschepens commented on July 19, 2024

Also, redeliverUnacknowledgedMessages(List<MessageIdImpl> messageIds) doesn't seem to be removing redelivered messages from the queue at any time, so the queue will always be stuck with redelivered messages.

I can't think of any simple way of solving this right now, maybe we can keep track of messages in the queue on a separate set.

from pulsar.

rdhabalia avatar rdhabalia commented on July 19, 2024

redeliverUnacknowledgedMessages : it cleans up all the messages present into incomingMessages and sends separate flow-message command which increments availablePermits at broker for a given consumer. So, consumer will not be stuck at any time.

However, right redeliverUnacknowledgedMessages doesn't clean up incomingMessages queue and asks broker for redelivery. So, as soon as client consumes N/2 messages from the incomingMessages queue it triggers flow-message command to broker and broker will first release those redelivered messages as part of received permits. In this case: again consumer will not be stuck.

Also, redeliverUnacknowledgedMessages(List messageIds) doesn't seem to be removing redelivered messages from the queue at any time

Yes, we have to make similar change of redeliverUnacknowledgedMessages to clean up from incomingMessages queue and sends permits to broker by triggering flow-message command.

from pulsar.

rdhabalia avatar rdhabalia commented on July 19, 2024

I will make changes and add test-cases for this scenario.

from pulsar.

sschepens avatar sschepens commented on July 19, 2024

@rdhabalia I just created a PR for this, please give it a look, perhaps you can think of a better way of approaching this.

from pulsar.

rdhabalia avatar rdhabalia commented on July 19, 2024

Ok. thanks, I will look into it.

from pulsar.

sschepens avatar sschepens commented on July 19, 2024

@merlimat @rdhabalia any news on this? We really need to solve this issue

from pulsar.

merlimat avatar merlimat commented on July 19, 2024

@sschepens just got back in office. reviewing the PRs

from pulsar.

sschepens avatar sschepens commented on July 19, 2024

Just to clarify, this issue was introduced when tracking timeout on messages not pulled from the queue.
Perhaps we can take a different approach to this, in the end what we want to prevent is a clientes to hold messages when it's not processing.
We could empty the queue and not as for messages until it resumes acknowledging messages or something of the sort.

from pulsar.

merlimat avatar merlimat commented on July 19, 2024

OK, it looks like it would be easier to just empty the queue and have the broker resend the all the messages that were on it. Anyway, they're not going to be "duplicates" since the application would not have seen them already.

from pulsar.

sschepens avatar sschepens commented on July 19, 2024

Yup, but we maybe should make the consumer not receive messages until it resumes acks. Just to prevent constant redelivery.

from pulsar.

merlimat avatar merlimat commented on July 19, 2024

I agree on that, the library should be playing with the permits to do that, but I'd keep it separate from this PR, because:

  1. It might be tricky to make sure we don't forget any corner case and leave the delivery stopped
  2. It should not be super-awful anyway.. you get 1000 messages resent every n-minutes

from pulsar.

merlimat avatar merlimat commented on July 19, 2024

Fixed in #101

from pulsar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.