The real prescription to stopping this is to only commit to looking at the problem for a few days regardless of how much progress you’re making. And never take on open-ended tasks with no sunset date. A CTO had me take an open-ended dev project once and I learned that the lack of a time box made it really miserable.