Skip to content
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

[FLINK-19518] Show proper job duration for running jobs in web ui #13560

Merged
merged 2 commits into from
Oct 15, 2020

Conversation

rmetzger
Copy link
Contributor

@rmetzger rmetzger commented Oct 8, 2020

What is the purpose of the change

Caused by FLINK-16866, the web UI is showing the "Duration" of a job as 0 in the overview. Once you open the detail page of a job, you see the correct duration.

Brief change log

  • Move createDetailsForJob to JobDetails
  • Call requestJob instead of requestJobStatus to get all the job details in DispatcherJob
  • Added an integration test.

Verifying this change

  • added a test
  • verified manually

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

Bugfix

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 8, 2020

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 6f5dffb (Thu Oct 08 07:23:24 UTC 2020)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 8, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@XComp XComp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, @rmetzger . I just have a few minor things. Additionally, I did a manual test to check whether the job overview shows the duration. ✅

int numTotalTasks = 0;

for (AccessExecutionJobVertex ejv : job.getVerticesTopologically()) {
AccessExecutionVertex[] vertices = ejv.getTaskVertices();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AccessExecutionVertex[] vertices = ejv.getTaskVertices();
AccessExecutionVertex[] taskVertices = ejv.getTaskVertices();

Could we do this renaming to improve the readability since we're dealing with different types of vertices in this code segment?

AccessExecutionVertex[] vertices = ejv.getTaskVertices();
numTotalTasks += vertices.length;

for (AccessExecutionVertex vertex : vertices) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (AccessExecutionVertex vertex : vertices) {
for (AccessExecutionVertex taskVertex : taskVertices) {

Same here with the vertex variable.

@@ -303,6 +303,55 @@ public void testCancel() throws Exception {
BlockingInvokable.reset();
}

/**
* See FLINK-19518. This test ensures that the /jobs/overview handler shows a duration != 0.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's a minor thing, but the extra line is not necessary here.

BlockingInvokable.latch.await();

final Duration testTimeout = Duration.ofMinutes(2);
final LocalTime deadline = LocalTime.now().plus(testTimeout);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deadline variable is never used. Are we missing an assert in this test or is this variable obsolete?

sender.setInvokableClass(BlockingInvokable.class);

final JobGraph jobGraph = new JobGraph("Stoppable streaming test job", sender);
final JobID jid = jobGraph.getJobID();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jid is never used and can be removed.

@rmetzger
Copy link
Contributor Author

Thanks a lot for your review. I addressed your comments.

@rmetzger
Copy link
Contributor Author

I'll merge it once CI has passed.

@rmetzger
Copy link
Contributor Author

Ci failed. Rebased to latest master.

@rmetzger
Copy link
Contributor Author

CI has passed now. Merging.

@rmetzger rmetzger merged commit 9ae7d81 into apache:master Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants