Skip to content

Commit

Permalink
Fix ChannelAlreadyClosed error in RateLimitersApiActionTest.testInval…
Browse files Browse the repository at this point in the history
…idDeleteScenarios (opensearch-project#4812)

Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks authored Oct 16, 2024
1 parent a1816fb commit 2ab9eaf
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ private void authFailureConfigApiRequestHandlers(RequestHandler.RequestHandlersB
// Try to remove the listener by name
if (config.dynamic.auth_failure_listeners.getListeners().remove(listenerName) == null) {
notFound(channel, "listener not found");
} else {
saveOrUpdateConfiguration(client, configuration, new OnSucessActionListener<>(channel) {
@Override
public void onResponse(IndexResponse indexResponse) {
ok(channel, authFailureContent(config));
}
});
}
saveOrUpdateConfiguration(client, configuration, new OnSucessActionListener<>(channel) {
@Override
public void onResponse(IndexResponse indexResponse) {
ok(channel, authFailureContent(config));
}
});
}).error((status, toXContent) -> response(channel, status, toXContent)))
.override(PUT, (channel, request, client) -> loadConfiguration(getConfigType(), false, false).valid(configuration -> {
ConfigV7 config = (ConfigV7) configuration.getCEntry(CType.CONFIG.toLCString());
Expand Down

0 comments on commit 2ab9eaf

Please sign in to comment.