afedulov commented on a change in pull request #15054:
URL: https://github.com/apache/flink/pull/15054#discussion_r603656650
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutor.java
##########
@@ -497,6 +505,32 @@ private void stopTaskExecutorServices() throws Exception {
// RPC methods
// ======================================================================
+ @Override
+ public CompletableFuture<TaskThreadInfoResponse> requestThreadInfoSamples(
+ final ExecutionAttemptID taskExecutionAttemptId,
+ final ThreadInfoSamplesRequest requestParams,
+ final Time timeout) {
+
+ final Task task = taskSlotTable.getTask(taskExecutionAttemptId);
+ if (task == null) {
+ return FutureUtils.completedExceptionally(
+ new IllegalStateException(
+ String.format(
+ "Cannot sample task %s. "
+ + "Task is not known to the task
manager.",
+ taskExecutionAttemptId)));
+ }
+
+ final CompletableFuture<List<ThreadInfoSample>> stackTracesFuture =
+ threadInfoSampleService.requestThreadInfoSamples(
+ SampleableTaskAdapter.fromTask(task), requestParams);
+
+ return stackTracesFuture.thenApply(
+ stackTraces ->
+ new TaskThreadInfoResponse(
+ requestParams.getRequestId(),
taskExecutionAttemptId, stackTraces));
Review comment:
This internal logic is "inherited" from the backpressure sampler that
was in use for a while
([sampleId](https://github.com/apache/flink/blob/7e4694b8198664300b13b5304c62271b192d4512/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/StackTraceSampleCoordinator.java#L161)).
I agree with you that it can probably be done better, but this bit is quite at
the core of the whole sampling process and I am afraid that I won't be able to
address it properly before the 12th of April. Because this parameter is wrapped
into the `ThreadInfoSamplesRequest`, getting rid of it won't need changes of
the public interfaces. Due to the time constrains I would ask to go for the
"trusted" solution for now and assign a ticket to me for the improvements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]