Skip to content

Commit

Permalink
[Bug] Check phase name before SearchRequestOperationsListener onPhase…
Browse files Browse the repository at this point in the history
…Start

Signed-off-by: David Zane <[email protected]>
  • Loading branch information
dzane17 committed Jan 26, 2024
1 parent 9f649e0 commit 87110b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Update supported version for max_shard_size parameter in Shrink API ([#11439](https://github.com/opensearch-project/OpenSearch/pull/11439))
- Fix typo in API annotation check message ([11836](https://github.com/opensearch-project/OpenSearch/pull/11836))
- Update supported version for must_exist parameter in update aliases API ([#11872](https://github.com/opensearch-project/OpenSearch/pull/11872))
- [Bug] Check phase name before SearchRequestOperationsListener onPhaseStart ([#12035](https://github.com/opensearch-project/OpenSearch/pull/12035))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ private void onPhaseEnd(SearchRequestContext searchRequestContext) {

private void onPhaseStart(SearchPhase phase) {
setCurrentPhase(phase);
this.searchRequestContext.getSearchRequestOperationsListener().onPhaseStart(this);
try {
SearchPhaseName.valueOf(phase.getSearchPhaseName().toString());
this.searchRequestContext.getSearchRequestOperationsListener().onPhaseStart(this);
} catch (IllegalArgumentException ignored) {}
}

private void onRequestEnd(SearchRequestContext searchRequestContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ private AbstractSearchAsyncAction<? extends SearchPhaseResult> searchAsyncAction
clusters,
searchRequestContext
);
return new SearchPhase(action.getName()) {
return new SearchPhase("none") {
@Override
public void run() {
action.start();
Expand Down

0 comments on commit 87110b5

Please sign in to comment.