UnconditionedLife / smum

SMUM Checkin for Santa Maria Urban Ministries (San Jose, California)
https://www.santamariasj.org
3 stars 0 forks source link

Print server crashes occasionally #182

Closed scott-r closed 5 months ago

scott-r commented 5 months ago

The print server crashes at random times, typically after running successfully for several days. Once it crashes, receipts queue up but do not print until the print server is restarted.

scott-r commented 5 months ago

Attempts to poll the receipt print queue fail from time to time, which is expected. Previously the print server would log these exceptions in the local trace file and continue. When we added the feature to also log these failures in the database error table, the logging attempt (which tries to use the same HTTP resource that just failed) produces another exception, which was uncaught and caused the program to crash.

The simple solution is to catch and ignore the exception when writing to the error log. Interestingly, testing shows that the second exception does not occur when running on Mac OS, but it apparently does happen on Windows.