This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208190 - Avoid running more instances of IDE with shared cache concurrently
Summary: Avoid running more instances of IDE with shared cache concurrently
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.1
Hardware: All All
: P4 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 10:42 UTC by Jiri Rechtacek
Modified: 2014-02-10 14:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Rechtacek 2012-02-09 10:42:11 UTC
I can run IDE netbeans --userdir ~/ud1 --cachedir /tmp/cache and concurrently netbeans --userdir ~/ud2 --cachedir /tmp/cache which causes any unexpected problems.
Comment 1 Antonin Nebuzelsky 2012-02-10 10:17:24 UTC
Jesse, can you look into implementing locking cachedir like we do for userdir.
Comment 2 Jesse Glick 2012-02-14 18:54:56 UTC
(In reply to comment #0)
> which causes [...] problems.

So do not do that then. How is this a P2?

As to locking cachedir in the same way as userdir, that is not possible since the userdir lock is closely tied to CLIHandler. Simply placing a lock file in the cachedir and releasing it on exit would not work since the lock would be stale if the JVM crashed - handled in the case of userdir by trying to send a command to the supposedly running IDE and clobbering the lock only after a timeout.

Possibly the IDE could write the location of the userdir to some file in the cachedir, deleting it on exit; if encountering an existing marker pointing to a different userdir, it would have to ping that app to see if it was still alive. The last part would require some modifications to CLIHandler (checking for liveness _without_ starting the app if not live) which jtulach would know the most about.
Comment 3 Jiri Rechtacek 2012-02-16 16:57:17 UTC
Assigned to new owner.