This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new b964814 Fix inconsistent behavior beween batch stoppable and single
stoppable API (#1879)
b964814 is described below
commit b964814d33f3920c861c7c6650c5ab6fb6237cbe
Author: Junkai Xue <[email protected]>
AuthorDate: Fri Sep 24 10:46:23 2021 -0700
Fix inconsistent behavior beween batch stoppable and single stoppable API
(#1879)
---
.../rest/server/resources/helix/PerInstanceAccessor.java | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git
a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/PerInstanceAccessor.java
b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/PerInstanceAccessor.java
index f7bb2af..0367e63 100644
---
a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/PerInstanceAccessor.java
+++
b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/PerInstanceAccessor.java
@@ -163,8 +163,21 @@ public class PerInstanceAccessor extends
AbstractHelixResource {
continueOnFailures, getNamespace());
StoppableCheck stoppableCheck;
try {
+ JsonNode node = null;
+ if (jsonContent.length() != 0) {
+ node = OBJECT_MAPPER.readTree(jsonContent);
+ }
+ if (node == null) {
+ return badRequest("Invalid input for content : " + jsonContent);
+ }
+
+ String customizedInput = null;
+ if
(node.get(InstancesAccessor.InstancesProperties.customized_values.name()) !=
null) {
+ customizedInput =
node.get(InstancesAccessor.InstancesProperties.customized_values.name()).textValue();
+ }
+
stoppableCheck =
- instanceService.getInstanceStoppableCheck(clusterId, instanceName,
jsonContent);
+ instanceService.getInstanceStoppableCheck(clusterId, instanceName,
customizedInput);
} catch (HelixException e) {
LOG.error("Current cluster: {}, instance: {} has issue with health
checks!", clusterId,
instanceName, e);