History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-28747
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Olesya Smirnova
Reporter: Eugene Kirpichov
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

IDEA 8 can't cope with dirty shutdown

Created: 19 May 08 15:21   Updated: 01 Aug 08 14:56
Component/s: IDE Configuration
Fix Version/s: Diana 8650

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows XP Pro SP2
Issue Links:
Duplicate
 
This issue is duplicated by:
IDEA-17791 Idea 7782 hangs on startup Resolved

Build: 8,280
Fixed in build: 8,641
Severity: Extreme


 Description  « Hide
I have twice shut down my computer in a dirty way (power button) with a project open in IDEA 8; both times it had some configuration files corrupted and I had to either re-create the project or manually find and remove these files. There were 2 or three of them and I had to remove them by one, waiting for IDEA to start loading the project and to tell me that file X is corrupt.
The files (something in .IntelliJIdea80\config\options), before I removed them, were completely filled with some special character, maybe NUL but I am not sure, it just showed up as ^@ in Vim.

Unfortunately I am not much willing to reproduce the bug and describe the precise steps now

It is strange that IDEA CAN'T open project with these files being corrupt, but it CAN open the project when they are completely missing.
Anyways, this feature alone is a showstopper for me to use IDEA 8 in its present state, because I can't predict when I may have to perform a dirty shutdown for some reasons.



 All   Comments   Work Log   Change History      Sort Order:
Dmitry Jemerov - 09 Jul 08 15:56
IDEA should detect this type of corruption and offer to delete the corrupted configuration files.

Alexander Strotzky - 24 Jul 08 12:50 - edited
Detecting corrupted files is good but only part of the right fix.

Ideally, the config files shouldn't become corrupted !

You can minimize the chances of this thing happening by:
1. Always, when saving a file myfile.xml, save the content to a temporary file and after you finish, rename the temporary file to myfile.xml (thus overwriting it). Renaming is done almost instantaneously and minimizes chances of corruption during writing in the file. In the worst case scenario, you would lose some settings, but you will still have a valid (not corrupted) file.
2. Minimize the time the file is open. In other words, keep at a minimum the time between stream.open() and stream.close().

By the way, this type of safe saving should also be applied to saving .iws, .ipr and .iml files. It happened more than once for the electric power to go down and not being able to open the project file after that because it got corrupted...