You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ilya Kasnacheev (JIRA)" <ji...@apache.org> on 2018/01/30 09:09:00 UTC

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

    [ https://issues.apache.org/jira/browse/IGNITE-7547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16344712#comment-16344712 ] 

Ilya Kasnacheev commented on IGNITE-7547:
-----------------------------------------

We have decided to postpone work on this issue, due to inability to check whether two Proxy objects correspond to same handler. So it would be possible to deploy two services with unrelated implementation under same name, which will violate expectations that Ignite places on services.

 

In case we decide to try and fix it, we should probably introduce our own Proxy container that can pass implementation to remote node, check if it matches, and then create Proxy on demand.

> 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
>            Assignee: Ilya Kasnacheev
>            Priority: Major
>
> 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)