we've got the same issue whether we use one counter or two or three. we could always check how long its been running and if its above a certain threshold we break out of the loop and log an error