Scenario : The server is in middle of processing a http request and the server shuts down. There are multiple points till where the code has executed. How are such cases typically handled ?. A typical example could be that some downstream http calls had to be made as a part of the incoming http request. How to find whether such calls were made or not made when the shutdown occurred. I assume that its not possible to persist every action in the code flow. Suggestions and views are welcome.
Such cases are handled in two main ways
The idea here is that something isn't complete until it's all complete. so regardless of what I've done so far, it's all discarded if for whatever reason it doesn't complete.
Whenever you do something that talks to a different system, log it. These are prime points of failure. You want to be able to raise alerts when something fails and investigate the reasons afterwards.
The message will be lost but the server did not give a response to the client that message was received thus the client has to retry.