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

Service not found exception when calling service method before initialization finished

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      When trying to call a method of a service after its assignment is written to cache, but before initialization is complete, then the following exception appears in log:

      [2017-10-06 16:33:14,688][ERROR][sys-#37%null%][GridTaskWorker] Failed to obtain remote job result policy for result from ComputeTask.result(..) method (will fail the whole task): GridJobResultImpl [job=C2 [c=ServiceProxyCallable [mtdName=foo, svcName=testService, ignite=null]], sib=GridJobSiblingImpl [sesId=1f1d3e1fe51-1d90f286-d1f5-452b-8e1e-621f218d0e3e, jobId=3f1d3e1fe51-1d90f286-d1f5-452b-8e1e-621f218d0e3e, nodeId=037457d8-e2d3-434b-8d34-70f152a3e777, isJobDone=false], jobCtx=GridJobContextImpl [jobId=3f1d3e1fe51-1d90f286-d1f5-452b-8e1e-621f218d0e3e, timeoutObj=null, attrs={}], node=TcpDiscoveryNode [id=037457d8-e2d3-434b-8d34-70f152a3e777, addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 172.25.4.149], sockAddrs=[/0:0:0:0:0:0:0:1%lo:47501, /127.0.0.1:47501, latitude.gridgain.local/172.25.4.149:47501], discPort=47501, order=17, intOrder=10, lastExchangeTime=1507296794313, loc=false, ver=2.1.0#19700101-sha1:00000000, isClient=false], ex=class o.a.i.IgniteException: Service not found: testService, hasRes=true, isCancelled=false, isOccupied=true]
      class org.apache.ignite.IgniteException: Remote job threw user exception (override or implement ComputeTask.result(..) method if you would like to have automatic failover for this exception).
      	at org.apache.ignite.compute.ComputeTaskAdapter.result(ComputeTaskAdapter.java:101)
      	at org.apache.ignite.internal.processors.task.GridTaskWorker$5.apply(GridTaskWorker.java:1027)
      	at org.apache.ignite.internal.processors.task.GridTaskWorker$5.apply(GridTaskWorker.java:1020)
      	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6640)
      	at org.apache.ignite.internal.processors.task.GridTaskWorker.result(GridTaskWorker.java:1020)
      	at org.apache.ignite.internal.processors.task.GridTaskWorker.onResponse(GridTaskWorker.java:838)
      	at org.apache.ignite.internal.processors.task.GridTaskProcessor.processJobExecuteResponse(GridTaskProcessor.java:1066)
      	at org.apache.ignite.internal.processors.task.GridTaskProcessor$JobMessageListener.onMessage(GridTaskProcessor.java:1301)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1556)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1184)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
      	at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1097)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: class org.apache.ignite.IgniteException: Service not found: testService
      	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1850)
      	at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:566)
      	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6608)
      	at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:560)
      	at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:489)
      	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
      	at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1181)
      	at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1908)
      	... 7 more
      Caused by: class org.apache.ignite.internal.processors.service.GridServiceNotFoundException: Service not found: testService
      	at org.apache.ignite.internal.processors.service.GridServiceProxy$ServiceProxyCallable.call(GridServiceProxy.java:408)
      	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1847)
      	... 14 more
      

      After that method call waits for initialization to finish and returns successfully. Exception in log looks misleading and makes people think that something went wrong, but actually everything works as expected. This exception should either be muted or replaced with some meaningful message.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmekhanikov Denis Mekhanikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: