-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Handle the failure due to reaching the servlet capacity when getting user tasks #10768
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,8 +34,8 @@ | |||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApi; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApiImpl; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRebalanceResponse; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlResponse; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRestException; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlUserTasksResponse; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.RebalanceOptions; | ||||||
import io.strimzi.operator.cluster.operator.resource.cruisecontrol.RemoveBrokerOptions; | ||||||
import io.strimzi.operator.cluster.operator.resource.kubernetes.AbstractWatchableStatusedNamespacedResourceOperator; | ||||||
|
@@ -767,12 +767,20 @@ private Future<MapAndStatus<ConfigMap, KafkaRebalanceStatus>> onPendingProposal( | |||||
return p.future(); | ||||||
} | ||||||
|
||||||
private void handleUserTaskStatusResponse(Reconciliation reconciliation, CruiseControlResponse cruiseControlResponse, | ||||||
private void handleUserTaskStatusResponse(Reconciliation reconciliation, CruiseControlUserTasksResponse cruiseControlResponse, | ||||||
Promise<MapAndStatus<ConfigMap, KafkaRebalanceStatus>> p, String sessionId, | ||||||
Set<Condition> conditions, KafkaRebalance kafkaRebalance, | ||||||
ConfigMapOperator configMapOperator, boolean dryRun, | ||||||
String host, CruiseControlApi apiClient, | ||||||
AbstractRebalanceOptions.AbstractRebalanceOptionsBuilder<?, ?> rebalanceOptionsBuilder) { | ||||||
if (cruiseControlResponse.isMaxActiveUserTasksReached()) { | ||||||
LOGGER.warnCr(reconciliation, "The maximum number of active user tasks that can run concurrently has reached therefore will retry getting user tasks in the next reconciliation. " + | ||||||
"If this occurs often, consider increasing the value for max.active.user.tasks configuration."); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
configMapOperator.getAsync(kafkaRebalance.getMetadata().getNamespace(), kafkaRebalance.getMetadata().getName()) | ||||||
.onSuccess(loadmap -> p.complete(new MapAndStatus<>(loadmap, buildRebalanceStatusFromPreviousStatus(kafkaRebalance.getStatus(), conditions)))); | ||||||
return; | ||||||
} | ||||||
|
||||||
if (cruiseControlResponse.getJson().isEmpty()) { | ||||||
// This may happen if: | ||||||
// 1. Cruise Control restarted so resetting the state because the tasks queue is not persisted | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,38 @@ | ||||||
/* | ||||||
* Copyright Strimzi authors. | ||||||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||||||
*/ | ||||||
package io.strimzi.operator.cluster.operator.resource.cruisecontrol; | ||||||
|
||||||
import io.vertx.core.json.JsonObject; | ||||||
|
||||||
/** | ||||||
* Response to user tasks request | ||||||
*/ | ||||||
public class CruiseControlUserTasksResponse extends CruiseControlResponse { | ||||||
private boolean isMaxActiveUserTasksReached; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
/** | ||||||
* Constructor | ||||||
* | ||||||
* @param userTaskId User task ID | ||||||
* @param json JSON data | ||||||
*/ | ||||||
CruiseControlUserTasksResponse(String userTaskId, JsonObject json) { | ||||||
super(userTaskId, json); | ||||||
// The maximum number of active user tasks that can run concurrently has reached | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this comment be on the |
||||||
// Sourced from the error message that contains "reached the servlet capacity" from the Cruise Control response | ||||||
this.isMaxActiveUserTasksReached = false; | ||||||
} | ||||||
|
||||||
/** | ||||||
* @return True If the maximum number of active user tasks that can run concurrently has reached | ||||||
*/ | ||||||
public boolean isMaxActiveUserTasksReached() { | ||||||
return isMaxActiveUserTasksReached; | ||||||
} | ||||||
|
||||||
protected void setMaxActiveUserTasksReached(boolean maxActiveUserTasksReached) { | ||||||
this.isMaxActiveUserTasksReached = maxActiveUserTasksReached; | ||||||
} | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.