-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] introduce a life cycle phase that allows some error checking on definition #438
Comments
@jonseymour I believe this line does what you are asking. https://github.com/influxdata/kapacitor/blob/master/services/task_store/service.go#L489 Basically on saving an Task we fully instantiate an executing task to catch any errors. I see three levels were errors can occur.
On task |
Ok, I'll see if I can move one of the tests in #431 into a spot where it will be caught prior to runtime. |
Closed - already does exactly what I ask |
Actually, I am going to reopen this and use the revised implementation of #431 as an example of the feature that I think is needed. In the current implementation of #431 there are two tests I need to perform. Currently these tests run during task start. One of them could be implemented as a panic in It would be ideal if both tests could execute at definition time. What is needed, I think, is an optional Validate hook on each pipeline node that allows final validations to be applied to the fully constructed node, perhaps something like:
which is called to validate the node at the end of construction. |
Closed via #443 |
It'd be nice if the object model used to support pipeline construction supported a "validate" phase that could do sanity checking of a node's configuration at definition time in a well-defined manner.
As it stands, some checks can be done when a property method is called (and then, only if one resorts to calling panic()) but in other cases (such as the failure to call join.as() - see #331/#431) the checks can't be done until runtime. If the parse tree supported the ability to execute validations once the script has been parsed, there may be additional validations that could be applied during the definition phase. Performing such validations early, if possible, is usually better than letting them occur at runtime.
The text was updated successfully, but these errors were encountered: