Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Fix for get detector API (#290)
Browse files Browse the repository at this point in the history
We didn't return after sending back channel responses after one recent change.  Later, when we use the channel to send back responses again, we get " java.lang.IllegalStateException: Channel is already closed".  This PR fixes this issue.

This PR also removes an redundant setting.
  • Loading branch information
kaituo authored Oct 23, 2020
1 parent 6138f78 commit d1c54e5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ public List<Setting<?>> getSettings() {
AnomalyDetectorSettings.DETECTION_WINDOW_DELAY,
AnomalyDetectorSettings.AD_RESULT_HISTORY_ROLLOVER_PERIOD,
AnomalyDetectorSettings.AD_RESULT_HISTORY_MAX_DOCS,
AnomalyDetectorSettings.AD_RESULT_ROLLOVER_PERIOD,
AnomalyDetectorSettings.MAX_RETRY_FOR_UNRESPONSIVE_NODE,
AnomalyDetectorSettings.COOLDOWN_MINUTES,
AnomalyDetectorSettings.BACKOFF_MINUTES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ private AnomalyDetectorSettings() {}
Setting.Property.Dynamic
);

public static final Setting<TimeValue> AD_RESULT_ROLLOVER_PERIOD = Setting
.positiveTimeSetting(
"opendistro.anomaly_detection.ad_result_rollover_period",
TimeValue.timeValueHours(12),
Setting.Property.NodeScope,
Setting.Property.Dynamic
);

public static final Setting<TimeValue> AD_RESULT_HISTORY_ROLLOVER_PERIOD = Setting
.positiveTimeSetting(
"opendistro.anomaly_detection.ad_result_history_rollover_period",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public void onResponse(MultiGetResponse multiGetResponse) {
.onFailure(
new ElasticsearchStatusException("Can't find detector with id: " + detectorId, RestStatus.NOT_FOUND)
);
return;
}
id = response.getId();
version = response.getResponse().getVersion();
Expand Down

0 comments on commit d1c54e5

Please sign in to comment.