Bug 385108 - builds (esp. cancelled builds) should not block saves
Summary: builds (esp. cancelled builds) should not block saves
Status: CLOSED DUPLICATE of bug 329657
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-14 14:55 EDT by Derek Anderson CLA
Modified: 2013-06-13 04:23 EDT (History)
2 users (show)

See Also:


Attachments
screenshot of issue (21.37 KB, image/jpeg)
2012-07-14 14:56 EDT, Derek Anderson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Anderson CLA 2012-07-14 14:55:58 EDT
Build Identifier: 20110613-1736

sometimes eclipse takes a long time (many minutes) to cancel a build.  (if at all)  which this build cancel request is processing, all save operations are blocked.  this leads to lost code when the IDE crashes, or is killed by the user (because the build refuses to cancel).

nothing should block the save operation except the inability to acquire a write lock on the file being saved.  it's easier to mark a build as invalid (and rebuild) than to rewrite lost code.  alternatively: the user could be be prompted "saving now will invalidate your build - continue?"

Reproducible: Always

Steps to Reproduce:
1. hit ctrl-b (to start a build_
2. cancel the build
3. attempt to save a file
Comment 1 Derek Anderson CLA 2012-07-14 14:56:29 EDT
Created attachment 218729 [details]
screenshot of issue
Comment 2 Derek Anderson CLA 2012-07-14 14:58:08 EDT
which => while
Comment 3 Stephan Herrmann CLA 2012-07-15 08:41:03 EDT
(In reply to comment #0)
> sometimes eclipse takes a long time (many minutes) to cancel a build.  (if at
> all)

While I know that this can be annoying, it would be important to know
which builders are involved when a build becomes unresponsive.
I'd be surprised if one builder alone (e.g., the javabuilder) gets stuck,
I'd expect this to be a contention between several builders, or perhaps
contention with some external process, even.

>  which this build cancel request is processing, all save operations are
> blocked.  this leads to lost code when the IDE crashes, or is killed by the
> user (because the build refuses to cancel).
> 
> nothing should block the save operation except the inability to acquire a write
> lock on the file being saved.

It may not be a native file lock but likely a scheduling rule is blocking
the save operation. At that time forcing a write (which the current API
won't allow) could cause any kind of corruption, I'm afraid.

> it's easier to mark a build as invalid (and
> rebuild) than to rewrite lost code.  alternatively: the user could be be
> prompted "saving now will invalidate your build - continue?"

Ignoring scheduling rules is not a solution. The canonical solution would be
to identify the rogue builder(s) and ensure they react to cancel.
Alternatively, I could think of an emergency region, where files could
be saved even if scheduling rules prevent writing to their original location.

Any fundamental changes to resource handling would have to be addressed by
Platform/Resources, maybe they have more ideas. In JDT land we can only try
to identify contention involving the Java builder and try to resolve that.
Comment 4 Dani Megert CLA 2013-06-13 04:23:35 EDT

*** This bug has been marked as a duplicate of bug 329657 ***