This is an automated email from the ASF dual-hosted git repository.
jialiang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 0f5c1406d6 AMBARI-26341: Fix Batch restart not worked (#3962)
0f5c1406d6 is described below
commit 0f5c1406d600d4ae178bd87aba990031f46dc2fb
Author: jialiang <[email protected]>
AuthorDate: Sat Mar 22 17:15:55 2025 +0800
AMBARI-26341: Fix Batch restart not worked (#3962)
---
.../apache/ambari/server/scheduler/ExecutionScheduleManager.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
index b41a297a72..e4b13afea5 100644
---
a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
+++
b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
@@ -905,8 +905,7 @@ public class ExecutionScheduleManager {
}*/
protected BatchRequestResponse performApiGetRequest(String relativeUri,
boolean queryAllFields) {
- Client client = ClientBuilder.newClient();
- WebTarget target = client.target(relativeUri);
+ WebTarget target = extendApiResource(ambariWebResource, relativeUri);
if (queryAllFields) {
target = target.queryParam("fields", "*");
}
@@ -914,14 +913,14 @@ public class ExecutionScheduleManager {
try {
response = target.request().get();
} catch (Exception e) {
+ LOG.error("Exception occurred during API request to {}: {}",
relativeUri, e.getMessage(), e);
response = null;
}
return convertToBatchRequestResponse(response);
}
protected BatchRequestResponse performApiRequest(String relativeUri, String
body, String method, Integer userId) {
- Client client = ClientBuilder.newClient();
- WebTarget target = client.target(relativeUri);
+ WebTarget target = extendApiResource(ambariWebResource, relativeUri);
Response response;
try {
Invocation.Builder invocationBuilder =
target.request().header(USER_ID_HEADER, userId);
@@ -937,6 +936,7 @@ public class ExecutionScheduleManager {
throw new IllegalArgumentException("Invalid HTTP method: " + method);
}
} catch (Exception e) {
+ LOG.error("Exception occurred during API request to {}: {}",
relativeUri, e.getMessage(), e);
response = null;
}
return convertToBatchRequestResponse(response);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]