Skip to content

Conversation

reswqa
Copy link
Member

@reswqa reswqa commented May 15, 2023

What is the purpose of the change

Dispatcher#submitJob calls Dispatcher#isInGloballyTerminalState up to three times which might be expensive due to IO.

Brief change log

  • Only call isInGloballyTerminalState once in Dispatcher#submitJob.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

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

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

Documentation

  • Does this pull request introduce a new feature? no

@flinkbot
Copy link
Collaborator

flinkbot commented May 15, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @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.

Sorry for not getting back on that one earlier, @reswqa Thanks for working on it. I have a few minor comments. PTAL

@reswqa reswqa force-pushed the FLINK-32098-reduce-io branch from 8066c5b to 58683f5 Compare July 17, 2023 04:35
@reswqa
Copy link
Member Author

reswqa commented Jul 17, 2023

Sorry for not getting back on that one earlier.

It doesn't matter. Thanks @XComp for picking this up!

I'm confused by what you mean by "if it's safe enough". 🤔

The results returned may be different between multiple calls to isInGlobalyTerminalState (due to an entry may happened to be written to JobResultStore in the ioExecutor). In the implementation before the change, we can sense the change of this state faster (because multiple calls were made), and after the change, there is only one call. I don't think there should be any problems here, but I'm not very sure.

@reswqa
Copy link
Member Author

reswqa commented Jul 20, 2023

I have updated this but seems that this pull request page does not perceive this new commit. This is strange because the corresponding fork branch(https://github.com/reswqa/flink/commits/FLINK-32098-reduce-io) has already been updated. I don't know if it's my network issue or Github's service issue.

@XComp
Copy link
Contributor

XComp commented Jul 20, 2023

I suspect it to be a Github issue. I'm gonna check again tomorrow

@reswqa
Copy link
Member Author

reswqa commented Jul 21, 2023

@flinkbot run azure

1 similar comment
@reswqa
Copy link
Member Author

reswqa commented Jul 21, 2023

@flinkbot run azure

@reswqa
Copy link
Member Author

reswqa commented Jul 21, 2023

It seems that CI is very unstable caused by https://issues.apache.org/jira/projects/FLINK/issues/FLINK-32632.

@XComp
Copy link
Contributor

XComp commented Jul 21, 2023

I'm looking into FLINK-32632 and will get back to you on that PR afterwards

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.

LGTM 👍 Let's wait for CI to become stable again to have a final green CI run before merging.

@XComp
Copy link
Contributor

XComp commented Jul 25, 2023

@reswqa can you rebase the branch to most-recent master? FLINK-32632 is resolved.

…allyTerminalState up to three times which might be expensive due to IO
@reswqa reswqa force-pushed the FLINK-32098-reduce-io branch from a0b328a to 6fc03aa Compare July 25, 2023 13:14
@reswqa
Copy link
Member Author

reswqa commented Jul 25, 2023

Thanks for your reminder and efforts to fix FLINK-32632 👍 I have rebased this to latest master.

@XComp
Copy link
Contributor

XComp commented Aug 1, 2023

The 1.18 release managers allowed to merge this change even after the feature freeze (see ML discussion). I'm going to go ahead and merge this change.

@XComp XComp merged commit c6d58e1 into apache:master Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants