I just test Service Fabric in on-premise. I tested many failure scenarios, but one of them i can't verify. How SF behave when node works well, but application has crashed? For example i have stateless web api and after single request it's fails and shutdowns (almost unpossible, but it's only assumption). SF should known about it and in next request to the same node it should redirect request for same application type hosted in any other node, until application is not starting again? Am i right? On statefull it should do the same, but rather than redirect to other node it should use replica?
I try simulate this example using Restart-ServiceFabricDeployedCodePackage, but it's probably restart too fast and i can't validate my assumptions - i get timeout.
The assumption that Service Fabric will redirect requests to services is generally not true unless you're using the built-in Reverse Proxy (you'll know if you're using it because you will need to structure request URLs a certain way).
Assuming you are not using the built-in Reverse Proxy, then your services connect and communicate directly with each other on IP:port endpoints. Service Fabric is not in the request path. Service Fabric only provides service discovery.
SF detects process crashes. You can also report a fault from your service code. In these cases, SF will restart the process that crashed or replica that reported the fault. They may be restarted on a different node. Stateful service replicas will almost always failover to another node where an active secondary can be promoted to primary. Clients are responsible for resolving the new service endpoint or switching to a different instance if the service is stateless.