[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: leaving .lock files upon exit

kevin t wrote:
i have tried two versions of eclipse 3.1 and 3.3.1 and both behave the same way.

i have no plugins. i am running it from a temp directory that is fresh.

the most recent version is a 64bit version of 3.3.1 .

every time i exit eclipse the tools leaves the file .metadata/.lock in the workspace directory. eclipse then complains that the workspace is locked and refuses to start in that workspace.

i remove the file, and it starts just fine.

The way that the .lock mechanism is designed to work is such that the file intended to be left even when Eclipse exits. The strategy is that at startup, Eclipse looks for the .lock file and tries to overwrite it. If it can, that means there is no other process holding the file open, which means there is no other Eclipse instance using that workspace; so Eclipse overwrites the file (holds it open) and proceeds. Upon exit, Eclipse closes the file but leaves it in place.
The reason it works this way is so that workspaces cna reliably be "released" even if Eclipse or its host JVM were to crash. The process crashing will inherently release the file so that the next time Eclipse starts on that workspace it can overwrite.


Given that explanation, we still need to understand why the file is being held. Are you certain any previous eclipse processes are not hanging around, holding the .lock file open? There must be some other explanation, or a bug/incompatibility in the JVM you're using...

Hope this helps,
	Eric