| Summary: | Indexer deadlocks in JUnit tests | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Andrew Gvozdev <angvoz.dev> |
| Component: | cdt-indexer | Assignee: | Project Inbox <cdt-indexer-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, dj.houghton, jamesblackburn+eclipse, malaperle, mober.at+eclipse, mschorn.eclipse, yevshif |
| Version: | 8.0 | ||
| Target Milestone: | 8.1.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | 359698, 359851, 376141 | ||
| Bug Blocks: | 375601 | ||
|
Description
Andrew Gvozdev
(In reply to comment #0) > I am not able to finish cdt.ui unit tests ever. Here is relevant stack: Note that the stack is actually for tag CDT_8_0 - CDT 8.0 final. The method org.eclipse.core.internal.preferences.EclipsePreferences.flush() is now synchronized in 3.7.1, this is why we are seeing a deadlock now. From what I understand, even if a CProject is created without index (IPDOMManager.ID_NO_INDEXER) the PDOMSetupJob runs and gets a lock on fUpdatePolicies then preferences. Before that finishes, a call to setOption locks preferences then the changes to preferences triggers a call to getIndexer which locks fUpdatePolicies. I tried adding a bunch of joinIndexer calls right after creating a project in AddBlockCommentTest, FormatActionTest, RemoveBlockCommentTest, ShiftActionTest. But even doing that I get an occasional deadlock and it seems wrong to me to have to joinIndexer for projects configured with IPDOMManager.ID_NO_INDEXER. See bug 351231 for synchronized change. While it may be possible to find a workaround in CDT, I think the real problem is the new "synchronized" method in equinox.preferences. Due to Open Calls form inside the synchronized block, others may deadlock too. I have filed bug 359698 asking Equinox to fix the regression. (In reply to comment #3) > From what I understand, even if a CProject is created without index > (IPDOMManager.ID_NO_INDEXER) the PDOMSetupJob runs It sounds that we should avoid running the job if no indexer is assigned. Sounds like right thing to do even if we may want to wait out for the preferences bug to get fixed. (In reply to comment #6) I provided a workaround. *** cdt git genie on behalf of Markus Schorn ***
Bug 359485: Workaround deadlock with preferences.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=2ac81668e38d623ebe7d5b9439a5dbd20a020790
*** cdt git genie on behalf of Markus Schorn ***
Bug 359485: Workaround deadlock with preferences.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=242b783c8c4d32d13409ce099c72126ec7d24648
What are the steps/locations to load and run the CDT test versions that showed this failure? I have a patch for the core that I'd like to test. Thanks. (In reply to comment #10) > What are the steps/locations to load and run the CDT test versions that showed > this failure? I have a patch for the core that I'd like to test. Thanks. - Before you run the tests, I suggest to install CDT first from Indigo update site or download from http://download.eclipse.org/tools/cdt/builds/8.0.0/index.html (I recommend that). Our unit tests may have implicit dependencies which are hard to track. Not sure whether you may need gcc in your path, probably it's OK for cdt.ui not to have it. Install everything except "C++ Remote Launch" and "Target Communication Framework" not to pull some extra 3-rd party plugins. - CDT repository is ssh://user@git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git. - Clone it, check out tag CDT_8_0 and import core/org.eclipse.cdt.ui.tests project. - Find ui/org.eclipse.cdt.ui.tests.text/TextTestSuite.java and Run/Debug as JUnit Plugin Test. Note that deadlock is happening intermittently, in this bug FormatActionTest is reported. For me, it locked up most often in testBugs test. - Don't be too impatient, some tests may take some seconds to run but normally a test shouldn't take more than 30 sec. Cool, thanks for the detailed steps. I am able to check out the tests and run them. This was fixed, closing. For platform 3.8 we still rely on the workaround. The workaround itself needs to be removed before closing this bug. The workaround is not needed (I have tested it) with platform 3.7.2 or 3.8m6. I have removed the workaround for 8.1 and on the 8.0.x stream post 8.0.2. Note: The combination CDT 8.0.2 with platform 3.7.2 contains both the platform fix and the workaround which causes bug 375601. |