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

StateManager availability in ICommunicationListeners #49

Open
SeanFeldman opened this issue Mar 22, 2017 · 2 comments
Open

StateManager availability in ICommunicationListeners #49

SeanFeldman opened this issue Mar 22, 2017 · 2 comments

Comments

@SeanFeldman
Copy link

This is more of a question.

From the samples, it looks like StateManager is available when communication listeners are created/opened. For example, in the AlphabetPartitions sample, Alphabet.Web HttpCommunicationListener the usage of the state manager to access and write the RC "dictionary" seems to be possible the moment communication listener is opened (OpenAsync() in invoked). The request will be processed right away. Based on what I've seen, the state manager while available is not really usable until RunAsync() of a service in invoked.

Tried to sketch a lifecycle and state manager timeline
image

  1. Is that so?
  2. If StateManager cannot be used until certain point in the life-cycle of a stateful service, does that mean SF simply doesn't forward any HTTP requests to the service even though communication listeners OpenAsync() has been executed?
@masnider
Copy link
Contributor

  1. No - they're really orthogonal. Read this: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-lifecycle

  2. No - Most of the time SF isn't in the communication flow. As just one simple example the Azure LB could be what is sending to the service and there's no control there. Furthermore even when SF is in the path, the only control is whether the open of the listeners have completed. If they have, the service's addresses are registered in naming. At that point the service and those endpoints are discoverable and calls could start showing up. Even if we did wait for the state manager to be ready it could become unready at any time (quorum loss, upgrade, primary demotion for other reasons, whatever).

@SeanFeldman
Copy link
Author

SeanFeldman commented Mar 22, 2017

@masnider thank you. That means that there's a chance that first request to the service might actually fail.

The scenario I'm looking at is when consuming messages from an external queuing service from the communication listener upon OpenAsync() invocation. Just like in the documentation you pointed to, there's no real need in service`s RunAsync(). But that causes an exception when trying to operate on the reliable collection. Hence my question.

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