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

[Backport 2.8] Fetch index settings asynchronously (#135) #166

Merged

Conversation

mingshl
Copy link
Collaborator

@mingshl mingshl commented Jul 12, 2023

In some cases, like using ./gradlew run, I've run into issues where OpenSearch crashes, complaining that we're making a blocking call on a listener thread, because we fetch index settings to see if a result transformer has been configured for the current index.

I'm kind of surprised that we haven't run into this in production use-cases, but it may just be because assertions are not enabled in production. Regardless, blocking calls on listener threads are a bad idea, since that's how you run out of listener threads.

This change makes the index settings call asynchronous and chains the remaining logic off of that.

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

In some cases, like using ./gradlew run, I've run into issues where
OpenSearch crashes, complaining that we're making a blocking call on a
listener thread, because we fetch index settings to see if a result
transformer has been configured for the current index.

I'm kind of surprised that we haven't run into this in production
use-cases, but it may just be because assertions are not enabled in
production. Regardless, blocking calls on listener threads are a bad
idea, since that's how you run out of listener threads.

This change makes the index settings call asynchronous and chains the
remaining logic off of that.

Signed-off-by: Michael Froh <froh@amazon.com>
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Merging #166 (e432984) into 2.8 (2621536) will increase coverage by 0.08%.
The diff coverage is 81.63%.

@@             Coverage Diff              @@
##                2.8     #166      +/-   ##
============================================
+ Coverage     82.45%   82.54%   +0.08%     
- Complexity      300      303       +3     
============================================
  Files            42       42              
  Lines          1174     1180       +6     
  Branches        143      143              
============================================
+ Hits            968      974       +6     
  Misses          130      130              
  Partials         76       76              
Impacted Files Coverage Δ
...ch/relevance/configuration/ConfigurationUtils.java 66.66% <69.23%> (ø)
...rch/relevance/actionfilter/SearchActionFilter.java 85.45% <95.23%> (+0.69%) ⬆️
...arch/search/relevance/client/OpenSearchClient.java 80.00% <100.00%> (+2.22%) ⬆️

@mingshl mingshl marked this pull request as ready for review July 12, 2023 23:08
@mingshl mingshl merged commit 3b7285b into opensearch-project:2.8 Jul 12, 2023
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants