Creating Index in NEO version 2.1.7 goes to deadlock

I am trying to create index problematically using NEO 2.1.7 version. After few transactions it starts giving this message in messages.log file.

2020-06-11 13:05:23.768+0000 WARN [o.n.k.EmbeddedGraphDatabase]: GC Monitor: Application threads blocked for 6291ms.
2020-06-11 14:05:32.086+0000 WARN [o.n.k.EmbeddedGraphDatabase]: GC Monitor: Application threads blocked for 8323ms.
2020-06-11 15:05:40.459+0000 WARN [o.n.k.EmbeddedGraphDatabase]: GC Monitor: Application threads blocked for 8347ms.
2020-06-11 16:05:48.789+0000 WARN [o.n.k.EmbeddedGraphDatabase]: GC Monitor: Application threads blocked for 8323ms.
2020-06-11 17:05:57.199+0000 WARN [o.n.k.EmbeddedGraphDatabase]: GC Monitor: Application threads blocked for 8418ms.
2020-06-11 18:06:05.705+0000 WARN [o.n.k.EmbeddedGraphDatabase]: GC Monitor: Application threads blocked for 8557ms.

So when I go to NEO browser and try to create index manually there it starts giving this error:

LockClient[968] can't wait on resource RWLock[SCHEMA(0), hash=2142821335] since => LockClient[968] <-[:HELD_BY]- RWLock[SCHEMA(0), hash=2142821335] <-[:WAITING_FOR]- LockClient[184] <-[:HELD_BY]- RWLock[SCHEMA(0), hash=2142821335]

I understand this is a deadlock situation. But this happens quite often and the only way I can resolve it is restarting NEO service, Any solution on how this can be resolved? Thanks!

Neo4j 2.1.7 is very, very old - consider upgrading.

Did you wait until the schema index has been fully populated? My suspicion is that index population is still in progress and you're running a query that could benefit from that index. Since it's not fully populated the index will not be used during population - this might cause the issues.

Thanks Stefan! Yes upgrading is what I am going to do next. I am not executing any other queries that could benefit from index. It just takes very very long and eventually dies or goes to deadlock. I am wondering if that's because of multiple indexes been created simultaneously or the number of nodes in my graph.

I remember some issues on older version when creating multiple indexes in parallel. Therefore try to create one after the other and ensure the previous one is fully populated before you proceed.