[infinispan-issues] [JBoss JIRA] (ISPN-2485) DefaultExecutorService.DistributedTaskBuilder timeout(long to, TimeUnit u) doesn't use the passed to timeout
Anna Manukyan (JIRA)
jira-events at lists.jboss.org
Wed Nov 7 05:28:18 EST 2012
[ https://issues.jboss.org/browse/ISPN-2485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732369#comment-12732369 ]
Anna Manukyan commented on ISPN-2485:
-------------------------------------
Aaa, ok - understood. But the thing is that, in any case there is a bug, as the code doesn't take into account the passed timeout parameter. With my change, even if the passed parameter is < repl. sync timeout, the timeout is set to the passed one.
If the logic is so that the timeout should be >= repl. sync timeout, then we can add if statement, so that the passed timeout is considered if it is greater than the repl. sync timeout, otherwise the timeout is set to repl. sync timeout value.
Currently, with change that I did, the tests are passed so the logic works in the way I've described in the bug.
> DefaultExecutorService.DistributedTaskBuilder timeout(long to, TimeUnit u) doesn't use the passed to timeout
> ------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-2485
> URL: https://issues.jboss.org/browse/ISPN-2485
> Project: Infinispan
> Issue Type: Bug
> Components: Distributed Execution and Map/Reduce
> Reporter: Anna Manukyan
> Assignee: Vladimir Blagojevic
>
> Hi,
> the issue is the following:
> 1. DistributedTaskBuilder is created with callable which sleeps for 10 seconds.
> 2. The timeout is set to DistributedTaskBuilder for 10 milliseconds.
> 3. Then the built DistributedTask is executed with DefaultExecutorService on the different node rather than the executorservice was attached to.
> 4. In 10 milliseconds, the TimeoutException should be thrown, but it doesn't.
> The thing is, that although timeout is passed to timeout(long timeout, TimeUnit unit) method of DefaultExecutorService.DistributedTaskBuilder class, but the method parses and sets not the passed value, but the one which was given to task builder during initialization.
> Please find the reproducing test here:
> https://github.com/andyuk1986/infinispan/blob/DIST_EXEC_TESTS/core/src/test/java/org/infinispan/distexec/DistributedExecutorTest.java
> Please find the proposed fix here:
> https://github.com/andyuk1986/infinispan/blob/DIST_EXEC_TESTS/core/src/main/java/org/infinispan/distexec/DefaultExecutorService.java (line 734)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list