Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7547

Failing to deploy service created by Proxy.newProxyInstance() on multiple nodes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4
    • None
    • compute
    • None

    Description

      When a new node comes with a service which is already defined in the cluster (by name), the following check is made:

      deployed.configuration().equalsIgnoreNodeFilter(newCfg)

      It checks for several parameters, including Service's class.equals().

      If a normal class is used, it will work. However, sometimes Service implementation is created with java.lang.reflect.Proxy.newProxyInstance().

      This method creates new classes on demand. They will have names like $ProxyNN, where NN is ordinal which cannot be depended on. On different nodes the ordering of proxies will be different. This means that equality for these classes cannot be dependent on.

      And indeed it causes problems, as follows

      Caused by: class org.apache.ignite.IgniteCheckedException: Failed to deploy service (service already exists with different configuration) [deployed=LazyServiceConfiguration [srvcClsName=com.sun.proxy.$Proxy0, svcCls=, nodeFilterCls=], new=LazyServiceConfiguration [srvcClsName=com.sun.proxy.$Proxy1, svcCls=$Proxy1, nodeFilterCls=]]
          at org.apache.ignite.internal.processors.service.GridServiceProcessor.writeServiceToCache(GridServiceProcessor.java:689)
          at org.apache.ignite.internal.processors.service.GridServiceProcessor.deployAll(GridServiceProcessor.java:590)

      My proposal follows: we should check that both classes respond to Proxy.isProxyClass() before comparing classes. If they are, consider them equal. I don't think we can check more.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ilyak Ilya Kasnacheev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: