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

Andrey Gura updated IGNITE-2646:
--------------------------------
    Description: 
{{GridTaskWorker}} can invoke {{reduce}} method in caller thread.

If task isn't annotated by {{@ComputeTaskMapAsync}} then job mapping will be 
run in caller thread. Since job mapping will be finished 
{{processDelayedResponses}} method will be invoked and if delayed responses 
queue isn't empty then caller thread can invoke {{reduce}} method eventually 
and perform reducing synchronously.

It can be usefull in case of synchronous execution but, it is strange behavior 
for asynchronous case because user expects that method will return after 
creation of task.

Similar behavior is possible for all places where code invokes 
{{GridTaskProcessor.execute()}} method ({{IgniteCompute.broadcast()}}, 
{{IgniteCache.size()}}, REST handlers, etc.)

Related discussion on dev-list: [IgniteCompute.withAsync can execute tasks 
synchronously|http://apache-ignite-developers.2346864.n4.nabble.com/IgniteCompute-withAsync-can-execute-tasks-synchronously-td7262.html]

  was:
{{GridTaskWorker}} can invoke {{reduce}} method in caller thread.

If task isn't annotated by {{@ComputeTaskMapAsync}} then job mapping will be 
run in caller thread. Since job mapping will be finished 
{{processDelayedResponses}} method will be invoked and if delayed responses 
queue isn't empty then caller thread can invoke {{reduce}} method eventually 
and perform reducing synchronously.

It can be usefull in case of synchronous execution but, it is strange behavior 
for asynchronous case because user expects that method will return after 
creation of task.

Similar behavior is possible for all places where code invokes 
{{GridTaskProcessor.execute()}} method ({{IgniteCompute.broadcast()}}, 
{{IgniteCache.size()}}, REST handlers, etc.)

Rerated discussion on dev-list: [IgniteCompute.withAsync can execute tasks 
synchronously|http://apache-ignite-developers.2346864.n4.nabble.com/IgniteCompute-withAsync-can-execute-tasks-synchronously-td7262.html]


> IgniteCompute.withAsync can execute tasks synchronously
> -------------------------------------------------------
>
>                 Key: IGNITE-2646
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2646
>             Project: Ignite
>          Issue Type: Bug
>          Components: compute
>    Affects Versions: 1.5.0.final
>            Reporter: Andrey Gura
>            Assignee: Andrey Gura
>
> {{GridTaskWorker}} can invoke {{reduce}} method in caller thread.
> If task isn't annotated by {{@ComputeTaskMapAsync}} then job mapping will be 
> run in caller thread. Since job mapping will be finished 
> {{processDelayedResponses}} method will be invoked and if delayed responses 
> queue isn't empty then caller thread can invoke {{reduce}} method eventually 
> and perform reducing synchronously.
> It can be usefull in case of synchronous execution but, it is strange 
> behavior for asynchronous case because user expects that method will return 
> after creation of task.
> Similar behavior is possible for all places where code invokes 
> {{GridTaskProcessor.execute()}} method ({{IgniteCompute.broadcast()}}, 
> {{IgniteCache.size()}}, REST handlers, etc.)
> Related discussion on dev-list: [IgniteCompute.withAsync can execute tasks 
> synchronously|http://apache-ignite-developers.2346864.n4.nabble.com/IgniteCompute-withAsync-can-execute-tasks-synchronously-td7262.html]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to