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

Don't replace the monitor set by a group when starting a new job #666

Conversation

fedejeanne
Copy link
Contributor

@fedejeanne fedejeanne commented Sep 8, 2023

  • Only set the progress monitor of the Job if it hasn't one already. This makes sure that the progress monitor set via Job::setProgressGroup is not replaced with a new one and ergo when the group is canceled, all the monitors in that group are canceled too.

  • Add regression test: JobTest.testSetProgressGroup_progressGroupIsCanceled_monitorInJobIsCanceled()

  • Simplify private method JobManager::createMonitor(Job) and remove the annotation @GuardedBy in it.

Fixes #664

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Test Results

       42 files  ±0         42 suites  ±0   57m 35s ⏱️ - 5m 23s
  3 771 tests +1    3 768 ✔️ +1    3 💤 ±0  0 ±0 
11 316 runs  +3  11 289 ✔️ +3  27 💤 ±0  0 ±0 

Results for commit 5b68124. ± Comparison against base commit 418fcfc.

♻️ This comment has been updated with latest results.

@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch 2 times, most recently from 23f484a to 2e978fb Compare September 8, 2023 12:19
@fedejeanne fedejeanne marked this pull request as ready for review September 8, 2023 13:44
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Changes look good to me. I obviously agree with the behavioral change in the JobManager, as stated in #654 (comment). I have some minor comments regarding code style within the added test.
And I would be in favor of separating the version bump from the functional changes in terms of different commits, but I am not sure if there is a policy for that.

@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch from 2e978fb to a055cfa Compare September 11, 2023 04:28
@fedejeanne
Copy link
Contributor Author

And I would be in favor of separating the version bump from the functional changes in terms of different commits, but I am not sure if there is a policy for that.

I'm not aware of one such policy but I'm 99% sure I have bumped the version in the same PR as the functional changes before. It makes sense to me since bumping the version is mandatory in this case :)

@mickaelistria
Copy link
Contributor

There is no strict policy, but the recommendation is to make the change and the bump as 2 distinct commits in the same PR, so the functional part can be cherry-picked to older branches more easily if needed. But we usually won't reject a PR if the bump is included in the same commit as the code change.

fedejeanne added a commit to fedejeanne/.github that referenced this pull request Sep 12, 2023
Add hints about providing 2 different commits in the PR when bumping
versions.

See
eclipse-platform/eclipse.platform#666 (comment)
fedejeanne added a commit to fedejeanne/.github that referenced this pull request Sep 12, 2023
Add hints about providing 2 different commits in the PR when bumping
versions.

See
eclipse-platform/eclipse.platform#666 (comment)
@fedejeanne
Copy link
Contributor Author

Thank you both for the hint, I'll take it into account from now on 👍

I created a PR to mention this in the documentation --> eclipse-platform/.github#151

mickaelistria pushed a commit to eclipse-platform/.github that referenced this pull request Sep 12, 2023
Add hints about providing 2 different commits in the PR when bumping
versions.

See
eclipse-platform/eclipse.platform#666 (comment)
@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch from a055cfa to eeda1d7 Compare September 12, 2023 08:00
@fedejeanne
Copy link
Contributor Author

I had to bump another version so I split the commits anyway

@HeikoKlare
Copy link
Contributor

Looks like the feature version of org.eclipse.core.runtime.feature has to be bumped as well, as the version of the included plugin org.eclipse.core.jobs was increased.
I wonder why this was not necessary when merging #625, as it bumped the version of org.eclipse.core.expressions, which is also included in that feature.

@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch from eeda1d7 to 0273f91 Compare September 12, 2023 11:47
@fedejeanne
Copy link
Contributor Author

fedejeanne commented Sep 12, 2023

Test failures documented in #678 and #668 (that last one should be fixed though --> rebasing)

- Only set the progress monitor of the Job if it hasn't one already.
This makes sure that the progress monitor set via Job::setProgressGroup
is not replaced with a new one and ergo when the group is canceled, all
the monitors in that group are canceled too.

- Add regression test:
JobTest.testSetProgressGroup_progressGroupIsCanceled_monitorInJobIsCanceled()

- Simplify private method JobManager::createMonitor(Job). Remove the
annotation "@GuardedBy" in it.

Fixes eclipse-platform#664
@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch from 0273f91 to bc44cdf Compare September 12, 2023 13:21
@HeikoKlare
Copy link
Contributor

The commit message of the version bump commit is not correct. It does neither bump the core.tests.runtime bundle version (I guess that was already done by another commit on which this PR was rebased) nor the version of the feature bundle.

I am not sure why the ToC tests (see #668) are failing again, as they succeeded in test runs this morning. There also seems to be some other configuration problem w.r.t. the changed jobs plug-in as the builds fail with validation errors:

Failed to execute goal org.eclipse.tycho:tycho-apitools-plugin:4.0.2:verify (verify) on project org.eclipse.core.jobs: Execute ApiApplication failed: Application returned exit code 10

The logs also show this, which I have not seen for the core.jobs plug-in in other builds yet:

The following implicit projects are not referenced: 
org.eclipse.platform:org.eclipse.core.jobs:eclipse-plugin:3.15.100-SNAPSHOT

@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch from bc44cdf to 7096c22 Compare September 13, 2023 07:13
* org.eclipse.core.jobs --> 3.15.100
@fedejeanne fedejeanne force-pushed the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch from 7096c22 to 5b68124 Compare September 13, 2023 07:14
@fedejeanne
Copy link
Contributor Author

The commit message of the version bump commit is not correct. It does neither bump the core.tests.runtime bundle version (I guess that was already done by another commit on which this PR was rebased) nor the version of the feature bundle.

Correct, org.eclipse.core.tests.runtime was bumped in 8a3f6d1 and org.eclipse.core.runtime.feature in 5531532. I reworded the commit.

I am not sure why the ToC tests (see #668) are failing again, as they succeeded in test runs this morning. There also seems to be some other configuration problem w.r.t. the changed jobs plug-in as the builds fail with validation errors:

Failed to execute goal org.eclipse.tycho:tycho-apitools-plugin:4.0.2:verify (verify) on project org.eclipse.core.jobs: Execute ApiApplication failed: Application returned exit code 10

The logs also show this, which I have not seen for the core.jobs plug-in in other builds yet:

The following implicit projects are not referenced: 
org.eclipse.platform:org.eclipse.core.jobs:eclipse-plugin:3.15.100-SNAPSHOT

No idea why since my changes are rather simple, nothing I haven't done before. Let's see if it's a random failure, I just rebased.

@HeikoKlare
Copy link
Contributor

Great, checks now run successfully.
The log message seems to only be related to a "cyclic dependency" as core.jobs has been bumped, the platform projects depend on equinox.registry which in turn depends on a package from core.jobs.

@HeikoKlare HeikoKlare merged commit 7ed493c into eclipse-platform:master Sep 13, 2023
14 checks passed
@fedejeanne fedejeanne deleted the bugs/664-dont-replace-existing-progress-monitor-when-starting-job branch September 13, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canceling a progress group doesn't cancel the monitors inside that group
3 participants