Github user davidyan74 commented on a diff in the pull request:
https://github.com/apache/incubator-apex-core/pull/321#discussion_r61779390
--- Diff:
engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java ---
@@ -492,6 +494,42 @@ public JSONObject
getContainer(@PathParam("containerId") String containerId) thr
return new JSONObject(objectMapper.writeValueAsString(ci));
}
+ @GET
+ @Path(PATH_PHYSICAL_PLAN_CONTAINERS + "/{containerId}" + "/stackTrace")
+ @Produces(MediaType.APPLICATION_JSON)
+ public JSONObject getContainerStackTrace(@PathParam("containerId")
String containerId) throws Exception
+ {
+ init();
+
+ if
(containerId.equals(System.getenv(ApplicationConstants.Environment.CONTAINER_ID.toString())))
{
+ return new JSONObject(StackTrace.getJsonFormat());
+ }
+
+ StreamingContainerAgent sca =
dagManager.getContainerAgent(containerId);
+
+ if (sca == null) {
+ throw new NotFoundException();
+ }
+
+ if (!sca.getContainerInfo().state.equals("ACTIVE")) {
+ throw new RuntimeException("Container is not active");
--- End diff --
This would return status code 500 to the user. We should probably return a
404.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---