Kill particle going around in infinite cycle

On occasion I appear to generate events which never terminate, because a photon gets stuck in an infinite loop, endlessly internally reflecting around a cylinder. How might such an infinite event be stopped?

More generally, in this configuration, many photons tend to bounce around the edges of the cylinder, long after any useful signal reaches the sensitive parts of the detector. To save simulation time, I’d like to implement something along the lines of "if the event’s global time exceeds T, just stop the event and execute EndOfEventAction". Can this be done?