Bug 578874 - faster java autobuild cancel when autobuild interrupt requested
Summary: faster java autobuild cancel when autobuild interrupt requested
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.23   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-21 08:42 EST by Jörg Kubitz CLA
Modified: 2022-03-09 03:26 EST (History)
3 users (show)

See Also:
mistria: pmc_approved?
mistria: review?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2022-02-21 08:42:22 EST
split from 578640:
JavaBuilder currently only asks for monitor.isCanceled() which is not enough.
Only Jobs which use org.eclipse.core.internal.resources.Workspace.prepareOperation(ISchedulingRule, IProgressMonitor) will activly cancel autobuild (Push notification).

Simple Jobs which directly use org.eclipse.core.internal.jobs.JobManager.beginRule(ISchedulingRule, IProgressMonitor) only appear as blocking, They require the blocking tasks to pull notification. AutoBuildJob.isInterrupted() does that pull. But Java builder does not call isInterrupted().
i.e. java builder currently is only interrupted between different builds. A big project autobuild can make some user operations lag.
Comment 1 Eclipse Genie CLA 2022-02-21 08:44:40 EST
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/191012
Comment 2 Jörg Kubitz CLA 2022-03-08 06:12:06 EST
I just found ancient discussion on whether JDT should support interrupt or not in  bug 89301.
The decision there was to not interrupt (short running) autobuild because JDT would lose the incremental state and would need a (long running) full build after interrupt. It has to be checked if that is still the case.
If so, it might be wise to only interrupt after a period of grace (like 3 sec) to verify the current autobuild is indeed short running.
I mean if the autobuild is long running anyway (sometimes we see ~2min on big projects) it won't matter to restart it with a long running build.
Comment 3 Andrey Loskutov CLA 2022-03-09 02:19:14 EST
In light of bug 579153, wouldn't this change lead to similar problem?
Comment 4 Jörg Kubitz CLA 2022-03-09 02:25:57 EST
(In reply to Andrey Loskutov from comment #3)
> In light of bug 579153, wouldn't this change lead to similar problem?

Absolutely. I am working on a better alternative:
Given that the user can currently not cancel autobuild during some operations (for example during UNDO - bug 578871) which can just freezes the UI for minutes i think it is best to autointerrupt after - say 3 sec.
Or if we could have a estimate about how long the current autobuild will take we could use that for a decision. It's totally appropriate to interrupt a long running autobuild.
Comment 5 Mickael Istria CLA 2022-03-09 03:26:02 EST
So if you want this be reverted before 4.23 is released, please send a mail ASAP to the platform-dev and eclipse-pmc mailing lists requesting it.