Skip to content
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

Handle any exception thrown while generating source for an IngestDocument #91981

Conversation

joegallo
Copy link
Contributor

Related to #91977

Regardless of what exception is thrown while generating source from an IngestDocument, we want to catch and handle the exception -- the contract for source(..., true) is that it can throw an IllegalArgumentException if there are self references, but now that we've seen other things go wrong inside the guts of that method (and given how hard they have been to diagnose!) I think a wider catch is justified (and remains justified even in a world where #91977 has been fixed).

@joegallo joegallo added >bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP Team:Data Management Meta label for data/management team v8.6.0 v8.7.0 v8.5.3 labels Nov 28, 2022
@joegallo joegallo requested a review from masseyke November 28, 2022 20:04
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine
Copy link
Collaborator

Hi @joegallo, I've created a changelog YAML for you.

joegallo and others added 2 commits November 28, 2022 15:05
It seems misleading to use IllegalArgumentException for the general
case of "something, anything, went wrong here".
Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

LGTM. As we've discussed offline I think we ought to broaden where we catch exceptions (since there are other places that would also result in the client never being notified). But this is definitely the most urgent and lowest risk place (since we have seen an exception right here in production).

The first catch block converts to an IllegalArgumentException which
maps to a 400. The second block converts to a RuntimeException which
maps to a 500.

For bwc reasons, we don't want to change the first block, but at the
same time it's not right to return a 400 for the second situation --
we don't know what happened and can't say for sure it's a problem with
the request.
@joegallo joegallo requested a review from masseyke November 28, 2022 21:11
Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

LGTM

@joegallo joegallo merged commit 4026ff2 into elastic:main Nov 29, 2022
@joegallo joegallo deleted the ingest-service-catch-concurrent-modification-exception branch November 29, 2022 14:03
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Dec 2, 2022
* upstream/main: (209 commits)
  Remove unused methods and classes from HLRC (elastic#92030)
  Clean up on exception while chunking XContent (elastic#92024)
  Add profiling plugin (elastic#91640)
  Remove unused methods and classes from HLRC (elastic#92012)
  Remove IndexerState from HLRC (elastic#92023)
  Ensure cached time elapses in ClusterServiceIT (elastic#91986)
  Chunked encoding for RestGetIndicesAction (elastic#92016)
  Simplify shardsWithState (elastic#91991)
  [DOCS] Updates ML decider docs by mentioning CPU as scaling criterion (elastic#92018)
  Add chunking to ClusterState.Custom impls (elastic#91963)
  Speedup time_series agg by caching current tsid ordinal, parent bucket ordinal and buck ordinal (elastic#91784)
  Drop the ingest listener call count tracking (elastic#92003)
  [DOCS] fixes issue number 91889 - missing [discrete] header (elastic#91976)
  Fix PersistentTasksClusterServiceTests (elastic#92002)
  [docs] Update search-settings documentation to reflect the fact that the indices.query.bool.max_clause_count setting has been deprecated (elastic#91811)
  Clarify writability in Netty4HttpPipeliningHandler (elastic#91982)
  Load stable plugins as synthetic modules (elastic#91869)
  Handle any exception thrown while generating source for an IngestDocument (elastic#91981)
  fixing Apache HttpHost url on java-rest doc (elastic#91945)
  Implement repair functionality for aliases colliding with indices bug (elastic#91887)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP Team:Data Management Meta label for data/management team v8.5.3 v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants