CENTRAL_LOCK2 is not properly initialized if used together with FORK channel. RequestHandler is never started, and doesn't process locking requests.
Basically this happens because CENTRAL_LOCK2 first receives VIEW_CHANGE event (when connecting main channel) and then SET_LOCAL_ADDRESS (when connecting fork channel). If fork is not used, the order is correct: first SET_LOCAL_ADDRESS and then VIEW_CHANGE.
Sequence of actions when creating fork channel:
- first main channel is created and connected
- JChannel sends "down" SET_LOCAL_ADDRESS event to protocols starting from top: FORK -> STATE -> etc (CENTRAL_LOCK2 doesn't receive this event because it is child of FORK)
- when connection is established GMS protocol builds the view and distributes the VIEW_CHANGE event up and down. So going up request reach FORK and FORK sends it to its child (CENTRAL_LOCK2)
- at this stage CENTRAL_LOCK2 doesn't have local_addr initialized yet - so condition for coordinator fails and RequestHandler is not started
- create and connect fork channel
- JChannel sends "down" SET_LOCAL_ADDRESS event to protocols starting from CENTRAL_LOCK2 - now local_addr is initialized
- when connection is established again GMS sends VIEW_CHANGE event
- now CENTRAL_LOCK2 see the coordinator hasn't changed (it compares local_addr with remembered coordinator - they are same), so it is not starting RequestHandler
In my view CENTRAL_LOCK2/Locking should reject all events from "up" method until local_addr is initialized.