neo4j/neo4j — pull request #1849 by tinwelint (2014-01-23 14:19:54+00:00)
Title: Fix for race between kernel panic and mode switching

where a thread switching role to slave and
HaKernelPanicHandler thread were competing to harden the master
delegate handler. While all components were switching to their slave
versions a kernel panic event came in and made its switch, ending with
hardening the master delegate handler. All components would take that
as a sign about the master delegate being ready to use. When the
slave switching was done, that thread would set the master delegate to
the actual one, but all components would have already gotten a concrete
reference to the master such that the latter setDelegate call would
not affect them.

Fix is to only have setDelegate() (not harden()) dereference the Concrete
instance so that a setDelegate() after harden() will override that
delegate, making it visible to the peers of it.