Bug 208190

Summary: Avoid running more instances of IDE with shared cache concurrently
Product: platform Reporter: Jiri Rechtacek <jrechtacek>
Component: Launchers&CLIAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW --- QA Contact: issues <issues.netbeans.org>
Priority: P4 CC: anebuzelsky, jglick
Version: 7.1   
Target Milestone: TBD   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: DEFECT Exception Report:

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.
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo