Repository navigation
Replies: 2 comments 2 replies
|
I really like the proposal, as it addresses a real usability issue. We also sometimes experience builds blocking user interaction and thus progress for longer periods of time. I cannot say anything about feasibility yet but want to contribute some thoughts on the motivational user experience part (also related to the mentioned alternatives):
|
|
Thanks for writing this up, @danthe1st - the problem is real and I think the The reason the current model is so coarse is mostly defensive: it's often I've run into similar problems before and found an "update lock" model @HeikoKlare's point is also valid, though: quietly deferring something like a That said, this is a non-trivial undertaking - redesigning the resources |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
If someone thinks this suggestion is "scary"/breaks (behavioral) compatibility too much, feel free to state that.
Nobody likes seeing the "User operation is waiting" when a project is built in the background.
Looking at the
Rulesclass, this is because thebuildRule()(which decides what can run when a build is running) returns the workspace root i.e. no operations acting on the workspace can do anything while a scheduled task with that rule is running.Should there be an option to set rule to something else (when possible), e.g. one global "build" rule that conflicts with every other build rule but nothing else? Or alternatively create an additional
buildRule(IProject)method that only requires exclusive access on the project and use that in places where this is possible?Of course, this might need to be guarded by a preference (probably initially disabled to use the old behavior) since that may have some impact (though we could maybe enable it for a milestone build and then disable it again).
It might be better to "only" try to change something like this on the m2e side only but I think having a discussion about that topic in general wouldn't hurt either.
The motivation is that some Maven projects (e.g. with Quarkus) take some time to build and changes to the POM (as well as some other things AFAIK) trigger a rebuild/reconfiguration which uses the build rule so saving a file or performing another action needs to wait for the operation to finish.
Note: This does not just happen when saving a file but it can also happen during state validation in the main thread when typing in the editor while a build is running ("Building"/
AutoBuildJob). Maybe thatDocumentProviderOperationcan be changed to not conflict with theAutoBuildJob?Alternatives
There are the following alternative approaches I considered:
ProjectConfigurationManagerwhich is used byUpdateMavenProjectJobto not use the global build rule but something project-specific. This could e.g. lock the project or itsproject.build.directory/targetfolder during the "Update Maven Project" (and possibly prevent multiple concurrent project updates if that is really needed).Example reproducer
If you want to reproduce that, you can use the following POM that just sleeps for 30s (at least on Linux). If you change the execution ID, save the POM and then save another file (in another project), it will wait.
Of course, waiting like this is a silly example but there are Maven projects where the build just takes a bit of time because of some plugins and Maven is not the only case where this might happen.
CC @HannesWell @laeubi since you are working on m2e.
All reactions