Potential race condition in InitializerExecutor

Description

The method InitializerExecutor::runInitializers(SimplePDPConfiguration) checks whether the initializers already ran and only executes the initializers if the test yields false.

However, the test is broken and allows for a race condition if multiple threads compete for the initialization of the same PDP instance. The initializers may execute multiple times in a multi-threaded scenario.

If we indeed need to protect a PDP form being initialized concurrently by multiple threads, then the test has to be changed to something like this:

1 2 3 if (!initializersRan.compareAndSet(false, true)) { // run initializers }

Environment

None

Status

Assignee

Florian Huonder

Reporter

Ralf Steppacher

Labels

None

Components

Fix versions

Affects versions

1.0.3.RELEASE

Priority

Minor
Configure