microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 399 forks source link

CloseAsync not invoke on app update? #217

Open dominikjeske opened 6 years ago

dominikjeske commented 6 years ago

CloseAsync of ICommunicationListener is not invoked during application update cousing rollback. Is this beheviour by design or maybe this is a bug?

vipul-modi commented 6 years ago

@bigdnf - is this is a stateful service? For the stateful service "Change Role" is called first and then close on the communication listener for the primary. If the change role is blocked, the UD will timeout and upgrade will rollback. During the upgrade you can use Get-ServiceFabricApplicationUpgrade (https://docs.microsoft.com/en-us/powershell/module/servicefabric/get-servicefabricapplicationupgrade?view=azureservicefabricps) command to get more information on what is blocking the upgrade.

The logic for state transitions for stateful and stateless services is here: https://github.com/Microsoft/service-fabric-services-and-actors-dotnet/blob/develop/src/Microsoft.ServiceFabric.Services/Runtime/StatefulServiceReplicaAdapter.cs

https://github.com/Microsoft/service-fabric-services-and-actors-dotnet/blob/develop/src/Microsoft.ServiceFabric.Services/Runtime/StatelessServiceInstanceAdapter.cs