[jira] [Created] (IGNITE-7547) Failing to deploy service created by Proxy.newProxyInstance() on multiple nodes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-7547) Failing to deploy service created by Proxy.newProxyInstance() on multiple nodes

Anton Vinogradov (Jira)
Ilya Kasnacheev created IGNITE-7547:
---------------------------------------

             Summary: Failing to deploy service created by Proxy.newProxyInstance() on multiple nodes
                 Key: IGNITE-7547
                 URL: https://issues.apache.org/jira/browse/IGNITE-7547
             Project: Ignite
          Issue Type: Bug
          Components: compute
    Affects Versions: 2.4
            Reporter: Ilya Kasnacheev


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
{code:java}
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){code}
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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)