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

GetAllSubscriptionHandles() breaks implicit subscriptions #9254

Open
nZeus opened this issue Nov 27, 2024 · 2 comments
Open

GetAllSubscriptionHandles() breaks implicit subscriptions #9254

nZeus opened this issue Nov 27, 2024 · 2 comments

Comments

@nZeus
Copy link

nZeus commented Nov 27, 2024

Hello,

We faced an issue related to how StreamConsumerExtension and implicit subscriptions work.
We noticed that invoking stream.GetAllSubscriptionHandles() within our Grain breaks behavior of its implicit subscription(s).

We drilled it down to the fact that GetAllSubscriptionHandles() calls BindExtensionLazy (

(myExtension, myGrainReference) = providerRuntime.BindExtension<StreamConsumerExtension, IStreamConsumerExtension>(() => new StreamConsumerExtension(providerRuntime));
) which creates StreamConsumerExtension with empty observer (
internal StreamConsumerExtension(IStreamProviderRuntime providerRt, IStreamSubscriptionObserver streamSubscriptionObserver = null)
{
this.streamSubscriptionObserver = streamSubscriptionObserver;
). The observer is not set in any other place.

As a result, messages cannot be delivered, because of this check:

else if(this.streamSubscriptionObserver != null)
, so we get Dropping on the floor error.

Could you please check why there is such a side-effect of GetAllSubscriptionHandles()?

Kind regards,
Ilia

@nZeus
Copy link
Author

nZeus commented Nov 27, 2024

I guess it is important to mention that if the IStreamSubscriptionObserver.OnSubscribed was executed before the GetAllSubscriptionHandles() then it works fine, but if we do GetAllSubscriptionHandles() before OnSubscribed is hit, then we get into this issue

@tomachristian
Copy link
Contributor

Another strange thing we found is that there is this

internal class StreamConsumerGrainContextAction : IConfigureGrainContext
which is registered as
services.AddSingleton<IConfigureGrainContext, StreamConsumerGrainContextAction>();
which is NOT USED. It might be when things got switched to using
public interface IConfigureGrainContextProvider
like
services.AddSingleton<IConfigureGrainContextProvider, MayInterleaveConfiguratorProvider>();
, but StreamConsumerGrainContextAction was somehow forgotten.

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

No branches or pull requests

2 participants