TBD54566975 / incubation-dcx

A Web5 Protocol for Decentralized Credential Exchange
Apache License 2.0
4 stars 8 forks source link

Make server fault tolerant #132

Open bnonni opened 2 months ago

bnonni commented 2 months ago

Summary

Currently, the server and issuer packages have server-like features that are not fault tolerant. If an error is thrown, it will bubble up to caller and kill the loop. We need to design and implement a simple and effective way to achieve fault tolerance for all server-like looping mechanisms involved in running dcx.

Requirements

bnonni commented 2 months ago

My first thought was the quickest and dirtiest way: simply try-catch the listen method. My concern is that I don't know what I don't know there, so I'm afraid I'm missing some glaring edge case that will still result in the loop dying.

Then, I began wondering if what a more elegant and performant solution might look like and thought we could integrate a use a node.js http server like the dwn-server, but I imagine that taking a bit more time, designing and thinking.

Worst case scenario, I can implement an overt amount of try-catchs and we can use a process manager like powerman (pm2) to restart any killed process.