0

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.

0

Such cases are handled in two main ways

  1. Atomic Transactions

    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.

  2. Logging

    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.

  • 1
    3. Wait for all pending transactions to complete or a timeout to occur (whichever comes first). Roll back all failed transactions and shut down. – Robert Harvey Apr 1 at 16:30
  • @Ewan : can you please elaborate on the logging part. Where to log ? – user2599052 Apr 2 at 7:46
  • what do you mean? log to a ELK box – Ewan Apr 2 at 7:49
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.