Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Steps to error proofing a mission critical process

I'm writing a program that will continuously process files placed into a hot folder.

This program should have 100% uptime with no admin intervention. In other words it should not fail on "stupid" errors. i.e. Someone deletes the output directory it should simply recreate it and move on.

What I'm thinking about doing is to code the entire program and then go through and look for "error points" and then add code to handle the error.

What I'm trying to avoid is adding erroneous or unnecessary error handling or even building error handling into the control flow of the program (i.e. the error handling controls the flow of the program). Well perhaps it could control the flow to a certain extent, but that would constitute bad design (subjective).

What are some methodologies for "error proofing" a "critical" process?

like image 439
user79755 Avatar asked Mar 06 '26 06:03

user79755


2 Answers

If your process must be error-proof and have no admin intervention, you must handle all possible errors. If you leave any chance of stopping the program, it will happen (Murphy's Law) and you will not know.

Even handling all possible errors, I think you'll need some logging and even a monitor with (mail?) alerts to be sure your process is always running fine.

like image 81
Paulo Guedes Avatar answered Mar 08 '26 21:03

Paulo Guedes


The most important thing to do is to document your assumptions in the form of unit tests. You should write a test that violates each assumption, and then prove that your program successfully recovers or takes action to make this state true again.

To use your example, if someone could delete the critical folder, make a test that simulates this and then show that your program handles this case without crashing.

like image 33
John Feminella Avatar answered Mar 08 '26 19:03

John Feminella



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!