Skip to content

revert PipelineFactoryError handling with throwing ElasticsearchParseException in ingest pipeline creation#16355

Merged
talevy merged 1 commit intoelastic:masterfrom
talevy:fix_ingest_exception
Feb 2, 2016
Merged

revert PipelineFactoryError handling with throwing ElasticsearchParseException in ingest pipeline creation#16355
talevy merged 1 commit intoelastic:masterfrom
talevy:fix_ingest_exception

Conversation

@talevy
Copy link
Copy Markdown
Contributor

@talevy talevy commented Feb 1, 2016

From discussion found here: #16276 (comment)

After some discussion, leveraging headers in ElasticsearchException is favored over wrapping structured response objects for errors.

@talevy talevy added WIP :Distributed/Ingest Node Execution or management of Ingest Pipelines labels Feb 1, 2016
@talevy talevy force-pushed the fix_ingest_exception branch 2 times, most recently from ec595b7 to 294470b Compare February 2, 2016 03:17
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this catch logic is needed here? We can just let any exception bubble up here, because this logic is executed when each node receives a new cluster state and is processing the pipeline config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

problem is that clusterChanged(ClusterChangeEvent event) signature does not allow throwing exceptions.

originally it was being caught and threw a RuntimeException to get away with it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I see. It is just that the caller will never see this exception, the node processing this exception just won't ack the cluster state update.

Also the if there is an issue during pipeline creation the failure is likely to be caused in the put() method as we construct the pipeline to see if something is wrong before submitting a cluster state update. The only time I think we end up throwing an exception here if when an ingest plugin isn't installed on all nodes. Some nodes will fail the processor factory for a specific type. If this would happen then it isn't a good situation to be in, so we should think about how to best tackle this problem and I think we should open an issue for this.

@martijnvg
Copy link
Copy Markdown
Member

@talevy looks good, I think we can remove ConfigurationPropertyException too?

@talevy talevy force-pushed the fix_ingest_exception branch 3 times, most recently from 3ab3cbf to 3efe843 Compare February 2, 2016 18:47
@talevy
Copy link
Copy Markdown
Contributor Author

talevy commented Feb 2, 2016

removed ConfigurationPropertyException and made ConvertProcessor throw ElasticsearchParseException when looking up Type from config.

@talevy talevy added review and removed WIP labels Feb 2, 2016
@talevy talevy force-pushed the fix_ingest_exception branch from 3efe843 to 19c62c1 Compare February 2, 2016 18:59
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use Type.fromString only here maybe should change Type.fromString() so that it throws the right exception? We would have to change the signature to accept a tag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't feel good about doing that... but OK, I will :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it isn't very nice... but I think better than throwing an excepting and then one method higher up in the stack catching that exception and re-throwing it.

@martijnvg
Copy link
Copy Markdown
Member

@talevy left one small comment. OTT LGTM

@talevy talevy force-pushed the fix_ingest_exception branch from 19c62c1 to 67fa48c Compare February 2, 2016 21:51
@talevy talevy force-pushed the fix_ingest_exception branch from 67fa48c to 0a1580e Compare February 2, 2016 22:08
talevy added a commit that referenced this pull request Feb 2, 2016
revert PipelineFactoryError handling with throwing ElasticsearchParseException in ingest pipeline creation
@talevy talevy merged commit 3191fc7 into elastic:master Feb 2, 2016
@talevy talevy deleted the fix_ingest_exception branch February 2, 2016 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Ingest Node Execution or management of Ingest Pipelines >enhancement v5.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants