You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Yakov Zhdanov (JIRA)" <ji...@apache.org> on 2017/05/17 14:47:04 UTC

[jira] [Commented] (IGNITE-4648) IgniteInternalTx.prepare() does not wait for async operations to complete

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

Yakov Zhdanov commented on IGNITE-4648:
---------------------------------------

Dmitry, can you please add a test that fails before the fix and passes after? In Ignite we try to react on a problem reported with a  test that fails. Then we fix the test. 

Please look at this test - org.apache.ignite.internal.processors.cache.AbstractCacheJtaSelfTest

You can add new test method and do some putAsync() for keys that are currently locked by pessimistic transactions in parallel threads. Then you commit JTA transaction and then commit cache transaction in parallel thread and then assert the results.

Thanks!

Yakov

> IgniteInternalTx.prepare() does not wait for async operations to complete
> -------------------------------------------------------------------------
>
>                 Key: IGNITE-4648
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4648
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 1.7
>            Reporter: Pavel Tupitsyn
>            Assignee: Ryabov Dmitrii
>            Priority: Minor
>             Fix For: 2.1
>
>
> {{commit}} and {{rollback}} wait for async operations by calling {{tx.txState().awaitLastFut();}} (see {{GridCacheSharedContext}}).
> There is no such thing in {{IgniteInternalTx.prepare()}} implementations.
> Since {{prepare}} is an internal method, this is not an issue mostly, except for two things:
> * JTA. {{CacheJtaResource}} calls {{prepare()}} explicitly. 
> * .NET {{TransactionScope}} API. Same thing as JTA, basically. {{PlatformTransactions}} call {{prepare()}} as well.
> As a result, if user starts an async operation within JTA transaction and then completes the tx, undefined behavior is possible.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)