[ 
https://issues.apache.org/jira/browse/IGNITE-12490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vyacheslav Daradur updated IGNITE-12490:
----------------------------------------
    Comment: was deleted

(was: Both issues: this and IGNITE-12490 can be fixed by improvements of our 
deployment guarantees, read this for details: 
[dev-list-thread|http://apache-ignite-developers.2346864.n4.nabble.com/Discovery-based-services-deployment-guarantees-question-td44866.html]

The main idea is allowing 
[GridServiceProxy#randomNodeForService|https://github.com/apache/ignite/blob/8cba313c9961b16e358834216e9992310f285985/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java#L283]
 to wait service deployment finished if it is registered in the cluster (but 
deployment has not finished yet).

It can be achieved in the same manner as for our ["API with a timeout" 
here|https://github.com/apache/ignite/blob/8dcd0f1d96dae965a0f5c479e6d0f4b4d50c6e2c/modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java#L821http://example.com]
 (mentioned as a workaround in current issue description).

Need add some conditions, something like this:
{code:java}
        IgniteUuid srvcUid = lookupRegisteredServiceId(name);

        if (srvcUid == null)
            return null; // Service is not registered in cluster: wasn't 
present in cfg and didn't deployed through API

        Map<UUID, Integer> top;

        while (true) {
            ServiceInfo srvcDesc = registeredServices.get(srvcUid);

            if (srvcDesc == null) {
                if (timeout == 0)
                    return null;
                else
                    // Wait if someone sent service to deploy (as in current 
implementation)
            }

            top = srvcDesc.topologySnapshot();

            if (!top.isEmpty()) {
                return top;
            }

            // Wait using "servicesTopsUpdateMux" while service deployment 
finished and the topology will not be empty
            // or removed from "registeredServices" in case if deployment 
failure
{code})

> Service proxy throws "Service not found" exception right after deploy
> ---------------------------------------------------------------------
>
>                 Key: IGNITE-12490
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12490
>             Project: Ignite
>          Issue Type: Improvement
>          Components: managed services
>    Affects Versions: 2.8
>            Reporter: Alexey Goncharuk
>            Priority: Major
>         Attachments: ServiceInvokeTest.java
>
>
> In the following scenario:
>  * Start nodes A, B
>  * Deploy a service on A
>  * Create a service proxy on B
>  * Invoke the proxy
> The proxy invocation throws a service not found exception. As per discussion 
> [on the dev 
> list|http://apache-ignite-developers.2346864.n4.nabble.com/Discovery-based-services-deployment-guarantees-question-td44866.html]
>  this case should be handled by an automatic retry, however, it's not.
> The reproducer is attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to