I don't think, that data region configuration causes these problems.
What makes you think so?

Try removing the event listeners and see, if these steps lead to the same
problem.

What kind of lock do you use? Is it *IgniteCache.lock()*, or
*Ignite.reentrantLock()*?
Anyways, I would get rid of these locks. You can make the oldest node in
the cluster to be in charge of the message processing.
It can be done as follows:

ignite.events().localListen((e) -> {
    IgniteCluster cluster = ignite.cluster();

    ClusterNode crd = cluster.forOldest().node();
    if (cluster.localNode().id().equals(crd.id()))
        System.out.println("Processing NODE_JOINED");

    return true;
}, EVT_NODE_JOINED);

You can also use *forOldest* along with some predicate to consider nodes of
some particular kind only.
More on cluster groups: https://apacheignite.readme.io/docs/cluster-groups

Denis

ср, 1 авг. 2018 г. в 19:51, wangsan <wqp1...@gmail.com>:

> Thank you for your answer,
> Maybe I use region config the wrong way.
> There are two apps(more apps with different roles) with different ignite
> configs,
> first App
>     :set default region with persistence enable
>     :set cache a,with nodefilter in first apps,default region
> second app
>     :set default region with persistence disable
>     :just access cache a with query
>
> start first app instance 1,second app instance 2,and first app instance 3.
> then close 1,
> then restart 1, the deadlock will happes
>
> fyi, I use ignitelock in first apps when process ignite discovery event
> such
> as join event.  when a new node join, apps 1,3 will receive join message by
> local event listener, but I just want one node to process the message, so i
> use it like this:
>
>         if (globalLock.tryLock()) {
>                 LOGGER.info("------  hold global lock ");
>                 try {
>                     switch (event.type()) {
>                         case EventType.EVT_NODE_JOINED:
>                             joinListener.onMessage(clusterNode);
>                             break;
>                         case EventType.EVT_NODE_FAILED:
>                         case EventType.EVT_NODE_LEFT:
>                             leftListener.onMessage(clusterNode);
>                             break;
>                         default:
>                             LOGGER.info("ignore discovery event: {}",
> event);
>                             break;
>                     }
>                 } finally {
>                     LOGGER.debug("------  process event done ");
>                     // don't unlock until node left
>                     // globalLock.unlock();
>                 }
>             }
>
> the node which hold the globalLock will never unlock unless it left, Is it
> the right way with lock
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Reply via email to