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 #275 #276

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix #275 #276

wants to merge 3 commits into from

Conversation

upils
Copy link

@upils upils commented Mar 23, 2022

This PR contains a fix for the issue but for now other PubSub tests are broken (eg. TestResendOnError).

I may have misunderstood how the Ack/Nack mechanism is supposed to work.

@roblaszczak @m110 I would love to discuss it further if you have some time.

Comment on lines 110 to +111

func TestPublishSubscribe_do_not_block_without_ack_required(t *testing.T) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a small function name to make it more concise?

@prashant3286
Copy link

Please resolve the test :)

s.logger.Trace("Sent message to subscriber without ack", logFields)
return
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The select below isn't really blocking execution, as it's running in another goroutine. BlockPublishUntilSubscriberAck is checked in Publish and that's where it blocks.

Can you share more about your use case?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m110 the current implementation will cause deadlock on all subscribers even if one of them did Ack/Nack a message. However I believe only the subscriber that does not Ack/Nack should lose the message leaving the rest processing goes through. So the setting to block publishing will deadlock if one subscriber does not Ack and I don't think that the intention.

Copy link

@Tochemey Tochemey Dec 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion will be to timeout when the BlockPublishUntilSubscriberAck is set to avoid the deadlock. That means when an Ack/Nack is not received after some time for a given subscriber the message is lost because the timeout will kick in and the context will be cancelled.

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.

4 participants