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

Cached service addresses are not invalidated and re-resolved when the address changes following a node/app restart or service upgrade #1

Open
dungimon opened this issue Jun 8, 2017 · 0 comments

Comments

@dungimon
Copy link

dungimon commented Jun 8, 2017

Repro Steps:

  1. Start the ServiceFabricGateway app and verify in the Service Fabric explorer.
  2. Start another fabric hosted service and verify in the Service Fabric explorer.
  3. Verify requests are correctly forwarded to this service via the ServiceFabricGateway app.
  4. Stop and re-start this service and verify different ports have been assigned in the Service Fabric explorer.
  5. Send requests to the service via the ServiceFabricGateway app.

It's during the final step you'll see the ServiceFabricGateway return a 500 response code with the exception message "No connection could be made because the target machine actively refused it [::1]:32001". The exception message should prove that the ServiceFabricGateway has cached the first resolved service address and is still forwarding requests to the old IP and port.

The ServiceFabricGateway app must be changed so that when a request is forwarded to an old cached address and fails to connect it must retry with the following steps:

  • Invalidate the cache
  • Resolve the address via the Service Fabric Naming Service and cache the address
  • Forward the request

This will ensure requests are forwarded correctly in the event of application and node restarts and application upgrades.

The following links provide suggestions on how this can be achieved with the IExceptionHandler interface:

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-communication
http://bartwullems.blogspot.co.uk/2016/09/azure-service-fabric-service-endpoint.html
https://dzimchuk.net/implementing-a-rest-client-for-internal-communication-in-service-fabric

dungimon added a commit that referenced this issue Jun 23, 2017
…is through our CI pipeline and deploy to our SF cluster to prove this resolves the issue since I can't reproduce locally (SF cluster behaves differently)
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

1 participant