Feature request? Setting a limit for loop iterations and recursion depth

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature request? Setting a limit for loop iterations and recursion depth

Maciej Arciuch
Hi,

is it possible to somehow limit the number of loop iterations and recursion depths in Orbeon? The system I'm maintaining is sort of a FormRunner, but anyone can register and publish a form. Unfortunately, people make mistakes which sometimes lead to infinite loops, which are highly undesired ;).

I know that you track the iteration number, because you present it in the logs:

DEBUG XFormsServer  - XForms -         action - executing {action name: "action", while iteration: "1"}
... (two weeks later)
DEBUG XFormsServer  - XForms -         action - executing {action name: "action", while iteration: "595204784"}
...

You probably keep the recursion depth as well, because you indent the log message appropiately:
DEBUG XFormsServer  - XForms - action1 - executing {...}
DEBUG XFormsServer  - XForms -   action2 - executing {...}
...
DEBUG XFormsServer  - XForms -           actionN - executing {...}

Is there any configuration option that would let the Orbeon administrator to simply end the processing of invalid forms after, say, N iterations or at recursion depth M? If not, would you accept this a feature request or guide me on how to implement it?

Best regards, Maciej Arciuch
Reply | Threaded
Open this post in threaded view
|

Re: Feature request? Setting a limit for loop iterations and recursion depth

Erik Bruchez
Administrator
Maciej,

Currently there is no such configuration, but absolutely, that would
be a great idea!

One place to look at is XFormsActionInterpreter.java:

http://github.com/orbeon/orbeon-forms/blob/master/src/java/org/orbeon/oxf/xforms/action/XFormsActionInterpreter.java

Another one is related to rebuild/recalculate/revalidate/refresh cycles:

http://github.com/orbeon/orbeon-forms/blob/master/src/java/org/orbeon/oxf/xforms/xbl/XBLContainer.java

(See "TODO: We might want to implement some code to detect excessive
loops/recursion").

If that is to be configurable by a property, see:

http://github.com/orbeon/orbeon-forms/blob/master/src/java/org/orbeon/oxf/xforms/XFormsProperties.java

I hope this helps as a start.

-Erik

On Tue, Dec 15, 2009 at 9:39 AM, Maciej Arciuch
<[hidden email]> wrote:

>
> Hi,
>
> is it possible to somehow limit the number of loop iterations and recursion
> depths in Orbeon? The system I'm maintaining is sort of a FormRunner, but
> anyone can register and publish a form. Unfortunately, people make mistakes
> which sometimes lead to infinite loops, which are highly undesired ;).
>
> I know that you track the iteration number, because you present it in the
> logs:
>
> DEBUG XFormsServer  - XForms -         action - executing {action name:
> "action", while iteration: "1"}
> ... (two weeks later)
> DEBUG XFormsServer  - XForms -         action - executing {action name:
> "action", while iteration: "595204784"}
> ...
>
> You probably keep the recursion depth as well, because you indent the log
> message appropiately:
> DEBUG XFormsServer  - XForms - action1 - executing {...}
> DEBUG XFormsServer  - XForms -   action2 - executing {...}
> ...
> DEBUG XFormsServer  - XForms -           actionN - executing {...}
>
> Is there any configuration option that would let the Orbeon administrator to
> simply end the processing of invalid forms after, say, N iterations or at
> recursion depth M? If not, would you accept this a feature request or guide
> me on how to implement it?
>
> Best regards, Maciej Arciuch
> --
> View this message in context: http://n4.nabble.com/Feature-request-Setting-a-limit-for-loop-iterations-and-recursion-depth-tp964356p964356.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws