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.x] Fetch index settings asynchronously (#135) #161

Merged

Conversation

mingshl
Copy link
Collaborator

@mingshl mingshl commented Jul 12, 2023

backport Fetch index settings asynchronously (#135)

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 <[email protected]>
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Merging #161 (cb19dcb) into 2.x (64948c5) will increase coverage by 0.07%.
The diff coverage is 80.85%.

@@             Coverage Diff              @@
##                2.x     #161      +/-   ##
============================================
+ Coverage     83.36%   83.44%   +0.07%     
- Complexity      328      331       +3     
============================================
  Files            42       42              
  Lines          1244     1250       +6     
  Branches        153      153              
============================================
+ Hits           1037     1043       +6     
  Misses          130      130              
  Partials         77       77              
Impacted Files Coverage Δ
...ch/relevance/configuration/ConfigurationUtils.java 66.66% <66.66%> (ø)
...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 16:59
@mingshl mingshl added backport 2.8 backport 2.x Backport to 2.x branch labels Jul 12, 2023
@mingshl mingshl merged commit dc1b183 into opensearch-project:2.x Jul 12, 2023
20 of 21 checks passed
@opensearch-trigger-bot
Copy link

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-161-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dc1b183d1964e1b0db9d8a465752449b4ec91028
# Push it to GitHub
git push --set-upstream origin backport/backport-161-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-161-to-2.x.

@opensearch-trigger-bot
Copy link

The backport to 2.6 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.6 2.6
# Navigate to the new working tree
cd .worktrees/backport-2.6
# Create a new branch
git switch --create backport/backport-161-to-2.6
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dc1b183d1964e1b0db9d8a465752449b4ec91028
# Push it to GitHub
git push --set-upstream origin backport/backport-161-to-2.6
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.6

Then, create a pull request where the base branch is 2.6 and the compare/head branch is backport/backport-161-to-2.6.

@opensearch-trigger-bot
Copy link

The backport to 2.8 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.8 2.8
# Navigate to the new working tree
cd .worktrees/backport-2.8
# Create a new branch
git switch --create backport/backport-161-to-2.8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dc1b183d1964e1b0db9d8a465752449b4ec91028
# Push it to GitHub
git push --set-upstream origin backport/backport-161-to-2.8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.8

Then, create a pull request where the base branch is 2.8 and the compare/head branch is backport/backport-161-to-2.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants