The GitHub Actions job "Coverage" on 
rocketmq.git/fix/route-info-manager-flat-lock has failed.
Run started by GitHub user zjncs (triggered by zjncs).

Head commit for run:
bed785de09bf4a45782f8baef446180e54ab8eea / zjncs <[email protected]>
[ISSUE #D12] Do not unlock RouteInfoManager locks that were never acquired

Eleven methods (registerTopic, both deleteTopic overloads,
registerBroker, unregisterBroker, pickupTopicRouteData, getAllTopicList,
getSystemTopicList, getUnitTopics, getHasUnitSubTopicList,
getHasUnitSubUnUnitTopicList) acquire the route lock with
lockInterruptibly() and release it in a finally block that is outside
the catch clause. When the thread is interrupted while waiting for the
lock, lockInterruptibly() throws InterruptedException, the catch clause
logs it, and the finally block still calls unlock() on a lock the
thread never acquired, so an IllegalMonitorStateException escapes the
method to the request processor. During namesrv shutdown, request
processor threads are interrupted while contending for the route lock,
turning graceful degradation into spurious IMSE errors.

Guard each unlock with isWriteLockedByCurrentThread() /
getReadHoldCount() so the lock is only released when it was actually
acquired. The lock field is now declared as ReentrantReadWriteLock,
which it always was at runtime.

Signed-off-by: zjncs <[email protected]>

Report URL: https://github.com/apache/rocketmq/actions/runs/34467691760

With regards,
GitHub Actions via GitBox

Reply via email to