-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ingest] - Error handling from simulate API #6675
[ingest] - Error handling from simulate API #6675
Conversation
Created a ticket to track it #6679 |
@@ -4,5 +4,6 @@ import _ from 'lodash'; | |||
|
|||
export default Joi.object({ | |||
processors: Joi.array().items(_.values(ingestProcessorSchemas)).required().min(1), | |||
input: Joi.object().required() | |||
input: Joi.object().required(), | |||
dirty_processor_id: Joi.string().optional() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keys are optional by default
This needs additional api tests under |
In the future, please split unrelated fixes like this into their own PR. |
input: {}, | ||
processors: [{ | ||
processor_id: 'processor1', | ||
type_id: 'set', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will test the set processor schema, not gsub
@BigFunger I'm done reviewing the current code, passing back to you for updates. Please create a ticket for cleaning up the dirty_processor logic once ES has improved their errors, and link to the ES ticket for it. |
@BigFunger Will you rebase this on feature/ingest? That'll get Spencer's ES fix into the branch and should get the tests running again. Also, does this PR block the addition of the other (non-regex based) processors? Or could I be reviewing those while you're making updates to this PR? |
@Bargs, it does block the addition of the other processors, because this PR redefines the base flow of how processors and the pipeline work. |
@BigFunger Since elastic/elasticsearch#17260 is already merged, let's remove the dirty_processor tracking from this PR. That should fix the problem with compilation error'd processors getting locked and should clean the code up nicely. |
Changes made per our discussion today and your above comments. I updated the description in the initial comment to reflect. |
There's a test failure in |
Summary
The initial version of the ingest server and client changes did not have logic to deal with when the simulate ES api would throw an error. It was written to always assume success. This is bad for two reasons: First, because things do not always go smoothly, and second because the gsub and grok processors that are coming in a later PR will throw an error if there is an invalid regular expression passed to them.
Changes
Added the dirtyProcessorId to the pipeline class. This will keep track of the processor that set the pipeline.dirty property to true. This way, if an error is raised, we know which processor caused it to happen.