Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 208190 - Avoid running more instances of IDE with shared cache concurrently
Avoid running more instances of IDE with shared cache concurrently
Status: NEW
Product: platform
Classification: Unclassified
Component: Launchers&CLI
All All
: P4 (vote)
Assigned To: Libor Fischmeistr
Depends on:
  Show dependency treegraph
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


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.

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