1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 14:25:37 +02:00
Find a file
Marc-Andre Laperle 3f0e34177c Bug 511677: Mitigate deadlock closing project during indexer job
A deadlock can occur if a project is closing and an indexing job is
running.
There is a patch on Gerrit that reproduces the lock all the time:
https://git.eclipse.org/r/#/c/90603

Thread #1, closes the project (*workspace lock*), removes the binary
parser for this project. Around the same time...

Thread #2, is just about to start indexing the project
(PDOMRebuildTask).
  It visits the C model to collect source files. Because the binary
parser was removed, it reloads the project description, which triggers a
listener (CExternalSettingsManager) to get a *workspace lock*.

Thread #1 then blocks on cancelling the indexer, which will never happen
because it is blocked on getting the workspace lock.

This deadlock could happen for any code being called by the indexer
thread that gets a workspace lock before the indexer cancels itself.
Because so much code can be hooked up to the C model (extensions,
listeners, etc), it is difficult to guarantee that this will not happen.

- Possible option 1. Changing CExternalSettingsManager to execute
asynchronously (Job) breaks other code that expect the operation to be
synchronous. Doing this also does not guarantee that other code will not
get a workspace lock.

- Possible option 2. Cancelling the indexer before the binary parser is
removed from the map: does not break any tests but only cover this
particular case of the binary parser triggering the project description
reload. Any other code that triggers a project description reload (and
workspace lock) will still be an issue.

Option 2, although incomplete, seems the safest and more reasonable at
this point. Judging by the comments in bug 327126, to fix this properly
would require quite a big effort that I'm not sure anyone would do.

Change-Id: Ida7b45558e4430bc5cc9a1eb5ef25e8d19487c31
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-02-13 15:11:49 -05:00
build Auto-generate source features using tycho. 2017-01-25 16:14:03 -04:00
codan Bug 511229 - RFE: Add quick fixes for some basic gcc errors 2017-02-06 12:33:34 -05:00
core Bug 511677: Mitigate deadlock closing project during indexer job 2017-02-13 15:11:49 -05:00
cross Auto-generate source features using tycho. 2017-01-25 16:14:03 -04:00
debug Bug 506073 - Support address "range" when adding a memory watchpoint 2017-02-07 13:52:25 -04:00
doc Add missing reference to GDB Debugging Preferences (for DSF preferences) 2016-12-05 21:47:25 +00:00
dsf Bug 511057 - Number format breaks if debug starts with view pinned 2017-02-03 15:47:26 -05:00
dsf-gdb Add printouts to debug unit tests 2017-02-13 12:49:27 -04:00
jtag Bug 511243 - MI async mode shall not be activated for all cases when 2017-02-06 15:09:32 -05:00
launch Bug 510615 - Launch dialog, handle spaces in gdb path 2017-02-07 09:48:23 -05:00
llvm Bug 510615 - Launch dialog, handle spaces in gdb path 2017-02-07 09:48:23 -05:00
lrparser Removed obsolete code. 2017-02-05 21:23:41 -05:00
memory Bug 509577 - [Traditional Rendering] Local variables enclosing markings 2017-02-13 11:20:51 -04:00
native/org.eclipse.cdt.native.serial Fixes for Windows Serial Port. 2017-01-20 09:59:51 -05:00
qt Bug 402498 - Apply declaredBefore() filtering to index bindings 2017-01-09 03:55:43 -04:00
releng Remove AIX support 2017-02-05 21:16:48 -05:00
remote Update version to 9.3.0 2016-11-15 20:32:51 -05:00
testsrunner Auto-generate source features using tycho. 2017-01-25 16:14:03 -04:00
toolchains/arduino Update version to 9.3.0 2016-11-15 20:32:51 -05:00
upc Removed obsolete code. 2017-02-05 21:23:41 -05:00
util Update version to 9.3.0 2016-11-15 20:32:51 -05:00
visualizer Update version to 9.3.0 2016-11-15 20:32:51 -05:00
windows Update version to 9.3.0 2016-11-15 20:32:51 -05:00
xlc Removed obsolete code. 2017-02-05 21:23:41 -05:00
.gitignore Ignore NFS-created files. 2012-11-08 13:34:54 -08:00
pom.xml Update to Tycho 1.0.0 2017-02-13 15:04:49 -04:00