diff options
author | Christian W. Damus | 2016-07-22 15:33:58 +0000 |
---|---|---|
committer | Christian W. Damus | 2016-07-22 16:43:27 +0000 |
commit | d51a329bc1145d4b143ce198c0cb98b967851a27 (patch) | |
tree | 018fa91616164fe8e3bb9abe4bb2b5023dfca2aa /plugins/infra/emf/org.eclipse.papyrus.infra.emf | |
parent | 7eaaf246cc4741209cce704c5263c87e4ef23a51 (diff) | |
download | org.eclipse.papyrus-d51a329bc1145d4b143ce198c0cb98b967851a27.tar.gz org.eclipse.papyrus-d51a329bc1145d4b143ce198c0cb98b967851a27.tar.xz org.eclipse.papyrus-d51a329bc1145d4b143ce198c0cb98b967851a27.zip |
Bug 498359: [Index] UI deadlock in model save scenario
https://bugs.eclipse.org/bugs/show_bug.cgi?id=498359
Provide the current state of the index immediately when requested while
the current thread is processing resource changes. None of the re-index
jobs can proceed to modify the index, so it is as good and consistent a
picture of the index as can be provided and otherwise we would deadlock.
Change-Id: Ia0445d4712e6d8ef74c866e5354f308544a0670b
(cherry picked from commit b85f2af18637995fa532b51b474d2b75149d25df)
Diffstat (limited to 'plugins/infra/emf/org.eclipse.papyrus.infra.emf')
-rw-r--r-- | plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java index f13ff6e6830..6d59096f9b3 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java @@ -204,8 +204,10 @@ public class IndexManager { <V> ListenableFuture<V> afterIndex(InternalModelIndex index, Callable<V> callable) { ListenableFuture<V> result; - if (Job.getJobManager().find(this).length == 0) { - // Result is available now + if ((Job.getJobManager().find(this).length == 0) || wsRoot.getWorkspace().isTreeLocked()) { + // Result is available now, or the workspace is currently notifying on this, + // in which case none of the indexer jobs can run yet so we must return whatever + // is the current state of the index (or else certainly deadlock) try { result = Futures.immediateFuture(callable.call()); } catch (Exception e) { |