Node can hang in STARTING when cluster node status is requested (e.g. ZDU page) during startup

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 9.4.26
    • Component/s: Clustering, Upgrade - ZDU
    • None
    • 1
    • Severity 3 - Minor
    • 1

      Issue Summary

      During startup, spring-startup holds the Spring singleton lock while it creates HazelcastCacheManager (getMap()). If another node calls getNodeStates() at that point, which the ZDU page and /rest/zdu/cluster do every few seconds, the @SpringAware GetNodeState task blocks a Hazelcast generic operation thread on that same lock. Once every generic thread is blocked, getMap() can't finish and the node stays in STARTING. A slow cluster peer makes the window longer. This is separate from BSERV-20396 (Spring 6.2 only), because it reproduces on 9.4 with Spring 5.3.

      Steps to Reproduce

      1. Set up a 3 node cluster. Start node 3 with -Dhazelcast.operation.generic.thread.count=2 so the race is easy to hit.
      2. Slow down node 2 (for example docker update --cpus 0.1).
      3. Poll GET /rest/zdu/cluster on node 1 every 0.5s. ZDU mode can be on or off.
      4. Restart node 3 and take thread dumps while it is starting.

      Expected Results

      Node status requests don't block the starting node, and it starts normally.

      Actual Results

      Every generic operation thread is BLOCKED on the lock held by spring-startup, and Hazelcast logs Slow operation detected: MemberCallableTaskOperation. With no polling and the same slow node there are no blocked threads. In production (8 nodes, 24 generic threads) the node stayed in STARTING across several restarts.

      "spring-startup"  WAITING	at com.hazelcast.instance.impl.HazelcastInstanceProxy.getMap(HazelcastInstanceProxy.java:96)	at com.atlassian.cache.hazelcast.HazelcastCacheManager.<init>(HazelcastCacheManager.java:100)	- locked <0x00000000c18d4828> (a java.util.concurrent.ConcurrentHashMap)
      "hz.hazelcast.generic-operation.thread-0"  BLOCKED	- waiting to lock <0x00000000c18d4828> (a java.util.concurrent.ConcurrentHashMap)	at com.hazelcast.spring.context.SpringManagedContext.initialize(SpringManagedContext.java:50)	at com.hazelcast.executor.impl.operations.AbstractCallableTaskOperation$OffloadImpl.lambda$loadTask$0(AbstractCallableTaskOperation.java:110)
      

      Workaround

      • Close ZDU pages and stop anything polling /rest/zdu/cluster while a node starts.
      • Restart nodes one at a time, and fix any slow peer first.
      • Raising hazelcast.operation.generic.thread.count doesn't help, because it only moves the point where the pool fills up.

              Assignee:
              Unassigned
              Reporter:
              Amit Singh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: