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

DistributedPubSub: publishing to topics that have no subscribers doesn't produce any dead letters #5352

Closed
Aaronontheweb opened this issue Oct 28, 2021 · 2 comments

Comments

@Aaronontheweb
Copy link
Member

Version Information
Version of Akka.NET? 1.4.27
Which Akka.NET Modules? Akka.Cluster.Tools

Describe the bug
Once the final subscriber to a topic unsubscribes, no one is available to receive these messages published to this topic. Yet, when messages are published no DeadLetters are produced.

To Reproduce
Steps to reproduce the behavior:

  1. Subscribe to topic "foo" with one IActorRef
  2. Unsubscribe IActorRef from "foo"
  3. Wait for UnsubscribeAck
  4. Query CurrentTopics from Mediator - "foo" still appears.

This appears to be because:

Receive<NoMoreSubscribers>(msg =>
{
var key = Internal.Utils.MakeKey(Sender);
_buffer.InitializeGrouping(key);
Sender.Tell(TerminateRequest.Instance);
});

And the Prune operation never un-register any empty buckets once they've been created.

Expected behavior
Topic registrations should eventually be removed when not in use - or should publish to dead letters when there are no subscribers.

Actual behavior
If no one can receive a message published to a topic, whatever the reason, it should be logged as such - usually a DeadLetter.

@Aaronontheweb
Copy link
Member Author

More context on this bug - the behavior Akka.NET exposes when publishing to a topic that never had any subscribers is different: we always publish a deadletter when this happens.

@Aaronontheweb
Copy link
Member Author

Let me simplify this:

can you follow the steps above, publish to this topic, and not get a DeadLetter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant