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

Ensure DownloadJob.run(IProgressMonitor) provides monitor task details #585

Closed

Conversation

merks
Copy link
Contributor

@merks merks commented Dec 19, 2024

@merks
Copy link
Contributor Author

merks commented Dec 19, 2024

@ptziegler

An unfortunate consequence of using masterMonitor.slice(1), which creates a org.eclipse.core.runtime.SlicedProgressMonitor, is that a SlicedProgressMonitor does not report task details to the monitor being sliced. I'm not sure what improvement exactly that #576 brought but one consequence is that the master monitor has no details about the tasks and subtasks being monitored. This is particularly glaring in the installer where those details are funneled to the task log, e.g,

Downloading org.apache.felix.gogo.shell
Fetching org.apache.felix.gogo.shell_1.1.4.jar from https://eclipse.mirror.liteserver.nl/releases/2024-12/202412041000/plugins/ (57.69kB)

With the master monitor task details missing, the installer logs that its about to collect several hundred artifacts from some specific repository. e.g.,

Collecting 556 artifacts from https://download.eclipse.org/releases/2024-12/202412041000

But then sits their quietly until they are all done. I imagine that if one looked at the progress view there too the details about what is happening during the progress is also missing.

So rather than revert the change, I've ensure that the slice propagates the task details...

Copy link

Test Results

  375 files  ±0    375 suites  ±0   46m 59s ⏱️ +31s
1 904 tests ±0  1 901 ✅ ±0  3 💤 ±0  0 ❌ ±0 
6 712 runs  ±0  6 703 ✅ ±0  9 💤 ±0  0 ❌ ±0 

Results for commit 3a42275. ± Comparison against base commit 1cfa5de.

@ptziegler
Copy link
Contributor

ptziegler commented Dec 19, 2024

Whoops... That is indeed an oversight that I missed when I changed it. 😦

I'm not sure what improvement exactly that #576 brought but one consequence is that the master monitor has no details about the tasks and subtasks being monitored.

The problem is that getArtifact() internally calls beginTask() on the given IProgressMonitor. Because this is always the same "master" progress monitor, beginTask() is called multiple times on the same monitor, which is illegal.

So every time this method is called, a new IProgressMonitor instance needs to be used, so using a custom SlidedProgressMonitor should definitely work. But I wonder if it's cleaner to change the masterMonitor to a SubMonitor and then simply call newChild(), rather than creating an anonymous subclass...

See #586

@merks
Copy link
Contributor Author

merks commented Dec 19, 2024

I think your other solution is cleaner and therefore better. Thanks. 😄

@merks merks closed this Dec 19, 2024
@merks merks deleted the pr-download-job-task-details branch December 19, 2024 11:11
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.

2 participants