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

Perform Maven target dependency update in non-UI thread #1901

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ptziegler
Copy link
Contributor

Depending on how many artifacts are updated, this might be a long-running operation and should therefore be run without blocking the application.

Copy link

github-actions bot commented Nov 28, 2024

Test Results

  324 files  ±0    324 suites  ±0   53m 23s ⏱️ + 1m 40s
  686 tests ±0    663 ✅  - 1  20 💤 ±0  2 ❌ +2  1 🔥  - 1 
2 058 runs  ±0  1 995 ✅  - 1  60 💤 ±0  2 ❌ +2  1 🔥  - 1 

For more details on these failures and errors, see this check.

Results for commit b61df1c. ± Comparison against base commit 66b65ce.

♻️ This comment has been updated with latest results.

@ptziegler ptziegler force-pushed the non-blocking-maven-update branch 3 times, most recently from f49b773 to 1a4d43c Compare November 28, 2024 18:43
@@ -316,7 +312,7 @@ public void testUpdateMavenArtifactVersion() throws Exception {

table.select(12);
robot.button("Update").click();
readAndDispatch();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test is executed too fast. Because the update is now done in a separate thread, we get the "The wizard can't be closed because of an active operation" popup when trying to close it.

@ptziegler ptziegler force-pushed the non-blocking-maven-update branch 2 times, most recently from fdb0de1 to 7a69cf7 Compare November 28, 2024 19:12
@akurtakov akurtakov force-pushed the non-blocking-maven-update branch from 7a69cf7 to d49118a Compare February 21, 2025 06:33
@laeubi
Copy link
Member

laeubi commented Feb 21, 2025

@ptziegler can you check with latest release? I Think that I should have fixed this in PDE so it performs updates in a separate thread. If not let me know I think this is better handled in the PDE editor than directly in the target location implementation.

@ptziegler
Copy link
Contributor Author

@ptziegler can you check with latest release? I Think that I should have fixed this in PDE so it performs updates in a separate thread. If not let me know I think this is better handled in the PDE editor than directly in the target location implementation.

I've just tested it with org.eclipse.pde 3.13.3000.v20250228-0140 and org.eclipse.m2e.pde.target 2.1.1.20250223-0727 and the problem still exists.

More specifically, the issue lies with the following button, which is used to updated all selected dependencies. Those updates are done in the UI thread and if, like in my case, 200 or so artifacts are updated at once, the IDE freezes for ~1-2 minutes.

image

Given that this is purely an interaction between the dialog and Maven Central, I'm not sure if this has anything to do with PDE editor itself.

@laeubi
Copy link
Member

laeubi commented Mar 3, 2025

Given that this is purely an interaction between the dialog and Maven Central, I'm not sure if this has anything to do with PDE editor itself.

I see, I thought this is referencing to the update button in the target editor, so is there anything left here or can we merge this after conflicts are resolved?

@ptziegler ptziegler force-pushed the non-blocking-maven-update branch from d49118a to b329c70 Compare March 6, 2025 10:28
@ptziegler
Copy link
Contributor Author

I've rebased everything and fixed the merge conflict. Unless there are any related test failures, that should now include everything. If anyone is interested, this is how it looks like:

image

@ptziegler ptziegler force-pushed the non-blocking-maven-update branch from b329c70 to b051c26 Compare March 6, 2025 10:53
Updating the selected artifacts in the target dependency dialog might a
long-running operation, as a request needs to be sent to Maven Central,
and should therefore run without blocking the application.

Instead of being executed in the UI thread, this is now done in the
runnable context of the containing wizard.
@ptziegler ptziegler force-pushed the non-blocking-maven-update branch from b051c26 to b61df1c Compare March 6, 2025 12:09
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