Bug 448472 - Cycle while computing value LegacyHandlerService

ValueComputation.get() can be accessed from multiple threads, but has no
protection against multi-threaded access. One example of this is looking
up the handler of a command via HandlerServiceImpl.lookUpHandler(), from
a job. E.g. when closing a project, the CloseUnrelatedProjectsAction
will react to a resource change event, potentially looking up a handler
simultaneously to selection change handling for other Package Explorer
actions. One of the possible results is that an exception is thrown,
that complains about cycles.

This change retains the delegated computation without synchronization,
but storing the cached value is done in a synchronized block.

Furthermore the cycle detection is improved, so that concurrent access
is not reported as a cycle. This is done by walking the (thread local)
computation stack of the current context and looking for the current
computation, but only if the current computation is already ongoing upon
method entry; i.e. only in cases of concurrent access or actual cycles.

Change-Id: I0d211c22df0c5650922e09fb93e6aa6b9a8aff62
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2 files changed
tree: bfb1859834c52b3c34184fc62765800418d97c01
  1. bundles/
  2. features/
  3. tests/
  4. .gitignore
  5. CONTRIBUTING
  6. CONTRIBUTING.md
  7. LICENSE
  8. NOTICE
  9. pom.xml
  10. README.md
README.md

Contributing to Eclipse Platform runtime project

Thanks for your interest in this project.

Project description:

Platform runtime provides the background componentns for Eclipse based applications.

Website: https://projects.eclipse.org/projects/eclipse.platform

For more information, refer to the Platform UI wiki page.

How to contribute:

Contributions to Platform UI are most welcome. There are many ways to contribute, from entering high quality bug reports, to contributing code or documentation changes. For a complete guide, see the Platform UI - How to contribute wiki page page on the team wiki.

Test dependencies

Several test plug-ins have a dependency to the Mockito and Hamcrest library. Please install them from the Orbit Download page

Currently the following versions are required:

  • org.hamcrest;bundle-version=“1.3.0”,
  • org.mockito;bundle-version=“2.13”,

How to build on the command line

You need Maven 3.3.1 installed. After this you can run the build via the following command:

mvn clean verify -Pbuild-individual-bundles

Developer resources:

Information regarding source code management, builds, coding standards, and more.

Contributor License Agreement:

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!

Contact:

Contact the project developers via the project's “dev” list.

License

Eclipse Public License (EPL) 2.0