modelop / hadrian

Implementations of the Portable Format for Analytics (PFA)
Apache License 2.0
130 stars 49 forks source link

[Hadrian] Invoking user-defined functions externally needs to track start times #19

Open jmilleralpine opened 8 years ago

jmilleralpine commented 8 years ago

Currently, timeout tracking in generated engines relies on a startTime field being set at the beginning of the invocation. Exposed user-defined functions do not set this field, so the last setting from a begin/action/end invocation takes hold. This effectively means that a user has (timeout)ms to invoke UDFs before they turn into a source of error messages that gets reset when action is invoked again.

It appears, if I am understanding the code correctly, that it should be possible to generate a wrapping function that sets the startTime field when invoked externally. Since all user-defined functions and the begin/action/end triumvirate are synchronized on the runlock, this ought to be enough to make it work.

I am attempting to make this modification now, I'll open a PR if I get a solution working.