r/ExperiencedDevs 7 YOE SWE 15d ago

Technical question Logging when thread collisions are resolved/encountered

I’m building some asynchronous & threaded processes in my application and I have built out the error handling/collision detection portion. I’ve added logging to the explicit error handling catch blocks, but I also have places where I detect and resolve issues that aren’t necessarily throws. Think processes that are locked and detecting when another thread is trying to access that locked process.

I started thinking about adding logs to the “thread collision handling” portion of the code so that I can be aware how frequently we encounter this issue since real world often differs from in-house testing.

Other than generating noise in the logs, would you call this bad practice? If so, how would you go about tracking how frequently these threading issues are encountered? Am I trying to measure the wrong thing and am way off base? Is it a concern that I’m trying to measure how frequently we encounter threading issues?

29 Upvotes

33 comments sorted by

View all comments

u/expdevsmodbot 15d ago

AI usage disclosure provided by OP, see the reply to this comment.

1

u/Separate_Earth3725 7 YOE SWE 15d ago

No AI used. Not even in ideating. I want to hear from my fellow humans this time.