[rt-devel] Reentrant Scrips

Bruce Campbell bruce_campbell at ripe.net
Fri Jan 11 18:02:38 EST 2002

On Fri, 11 Jan 2002, Jesse Vincent wrote:

> Nothing innately taboo. but I can't think of a good way to catch infinite
> recursion there.  It sounds like a new and better way to shoot oneself in
> the foot ;)   I'd probably check to make sure that the transaction type you're
> about to create isn't the same as the transaction type that was just created.

Well, the simplest way is to put the onus on the RT Admin, but I really
doubt that every RT Admin is going to read any GREAT BIG WARNING messages
in the code ;)

My thoughts on avoiding recursion is simplified by the fact that I'm
putting a known string into the comment.  A match on this string in the
current transaction would therefore indicate a recursion loop, and we
don't prolong it ;).

I don't think that there would be any neat way of RT itself detecting when
Scrips are causing recursion, without building (in effect) a ScripStack
and bombing out when the same name appears an arbitary number of times.
A less-neat alternative would be for the Scrip to not run if the time
taken for this RT instance exceeds an arbitary number.

Besides, I can shoot myself in the foot with only 1 line of code, I don't
need the extra ~22,000 opportunities that RT offers me ;)

                             Bruce Campbell                            RIPE

More information about the Rt-devel mailing list