Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 64FBC1638CC for ; Tue, 25 Jul 2017 18:36:43 +0200 (CEST) Received: (qmail 2389 invoked by uid 500); 25 Jul 2017 16:36:42 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 2378 invoked by uid 99); 25 Jul 2017 16:36:42 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2017 16:36:42 +0000 Received: from mail-qk0-f181.google.com (mail-qk0-f181.google.com [209.85.220.181]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id B36D81A031E for ; Tue, 25 Jul 2017 16:36:40 +0000 (UTC) Received: by mail-qk0-f181.google.com with SMTP id d145so65403913qkc.2 for ; Tue, 25 Jul 2017 09:36:40 -0700 (PDT) X-Gm-Message-State: AIVw112GAN8D38aDpfleT5dKCJ09qPqhqXCMf7CNi+Orut0BgqopDjVt /NI2DSVGHb/45Ob2Tk6aADjUUqOMdWd0 X-Received: by 10.55.93.197 with SMTP id r188mr25957340qkb.277.1501000600201; Tue, 25 Jul 2017 09:36:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.12.200 with HTTP; Tue, 25 Jul 2017 09:36:09 -0700 (PDT) In-Reply-To: References: From: Pavel Tupitsyn Date: Tue, 25 Jul 2017 19:36:09 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: .Net client call tx,close in other thread To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="001a114cb1b8958f80055526ef8e" --001a114cb1b8958f80055526ef8e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've reproduced the issue, it happens because in .NET we auto-close the transaction on commit/rollback. This involves two things: * release .NET reference to Java object * call Transaction.close() With sync methods this is trivial, but with commitAsync/rollbackAsync we have to call close() in IgniteFuture listener, which is called in a different thread. I think we need to be able to close() a transaction from any thread. Otherwise I don't see a non-blocking way to deal with commitAsync/rollbackAsync. Thanks, Pavel On Tue, Jul 25, 2017 at 6:10 PM, =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9= =D0=98=D0=B6=D0=B8=D0=BA=D0=BE=D0=B2 wrote: > Hi, Pavel > > You can check my pull request. > https://github.com/apache/ignite/pull/2334 > > For now I return checks so it has to fail on .Net test suite > > > 2017-07-25 17:16 GMT+03:00 Pavel Tupitsyn : > > > Hi =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9, > > > > .NET test in question (TestTxStateAndExceptions) does not do any > > multithreading, > > everything is called from a single thread. > > > > I see that the latest .NET run of your pull request on TeamCity finishe= d > > successfully: > > http://ci.ignite.apache.org/viewLog.html?buildId=3D738277 > > > > Do you still have a problem with this? If yes, how can I reproduce it? > > Can you prepare a branch where the test fails, so I can run it locally? > > > > Thanks, > > Pavel > > > > On Tue, Jul 25, 2017 at 4:47 PM, =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0= =D0=B9 =D0=98=D0=B6=D0=B8=D0=BA=D0=BE=D0=B2 > > wrote: > > > > > Hello, Igniters. > > > > > > I working on issue https://issues.apache.org/jira/browse/IGNITE-5712 > > > I found that .Net client perform transaction operation(`tx.close()`) = in > > > thread that not owns transaction. > > > > > > So I can't include checks for threadId in my pull request. > > > > > > Is it a bug or a desirable behabiour? > > > > > > With my new check I got following stack trace: > > > > > > Check: > > > > > > `assert (threadId() =3D=3D Thread.currentThread().getId());` > > > > > > Exception: > > > > > > Test(s) failed. System.AggregateException : One or more errors > occurred. > > > ----> Apache.Ignite.Core.Common.IgniteException : Java exception > > occurred > > > [class=3Djava.lang.AssertionError, message=3D] ----> > > > Apache.Ignite.Core.Common.JavaException : java.lang.AssertionError at > > > org.apache.ignite.internal.processors.cache.transactions. > > > TransactionProxyImpl.enter0(TransactionProxyImpl.java:113) > > > at > > > org.apache.ignite.internal.processors.cache.transactions. > > > TransactionProxyImpl.enter(TransactionProxyImpl.java:106) > > > at > > > org.apache.ignite.internal.processors.cache.transactions. > > > TransactionProxyImpl.close(TransactionProxyImpl.java:317) > > > at > > > org.apache.ignite.internal.processors.platform.transactions. > > > PlatformTransactions.txClose(PlatformTransactions.java:136) > > > at > > > org.apache.ignite.internal.processors.platform.transactions. > > > PlatformTransactions.processInLongOutLong( > PlatformTransactions.java:178) > > > at > > > org.apache.ignite.internal.processors.platform. > PlatformTargetProxyImpl. > > > inLongOutLong(PlatformTargetProxyImpl.java:53) > > > at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean > > > includeTaskCanceledExceptions) at System.Threading.Tasks.Task. > Wait(Int32 > > > millisecondsTimeout, CancellationToken cancellationToken) at > > > System.Threading.Tasks.Task.Wait() at > > > Apache.Ignite.Core.Tests.Cache.CacheAbstractTransactionalTest > > > .TestTxStateAndExceptions() > > > in > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core.Tests\Cache\CacheAbstractTransactionalTest.cs:line > > > 510 --IgniteException at > > > Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.Error(Void* > target, > > > Int32 errType, SByte* errClsChars, Int32 errClsCharsLen, SByte* > > > errMsgChars, Int32 errMsgCharsLen, SByte* stackTraceChars, Int32 > > > stackTraceCharsLen, Void* errData, Int32 errDataLen) in > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core\Impl\Unmanaged\UnmanagedCallbacks.cs:line > > > 1066 at > > > Apache.Ignite.Core.Impl.Unmanaged.IgniteJniNativeMethods. > > > TargetInLongOutLong(Void* > > > ctx, Void* target, Int32 opType, Int64 val) at > > > Apache.Ignite.Core.Impl.Unmanaged.UnmanagedUtils.TargetInLongOutLong( > > > IUnmanagedTarget > > > target, Int32 opType, Int64 memPtr) in > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core\Impl\Unmanaged\UnmanagedUtils.cs:line > > > 429 at Apache.Ignite.Core.Impl.PlatformTarget.DoOutInOp(Int32 type, > > Int64 > > > val) in > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core\Impl\PlatformTarget.cs:line > > > 717 at > > > Apache.Ignite.Core.Impl.Transactions.TransactionsImpl. > > > TxClose(TransactionImpl > > > tx) in > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core\Impl\Transactions\TransactionsImpl.cs:line > > > 216 at Apache.Ignite.Core.Impl.Transactions.TransactionImpl.Close() i= n > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core\Impl\Transactions\TransactionImpl.cs:line > > > 442 at > > > Apache.Ignite.Core.Impl.Transactions.TransactionImpl.< > > > CloseWhenComplete>b__d(Task > > > x) in > > > c:\BuildAgent\work\820be461cd64b574\modules\platforms\dotnet\Apache. > > > Ignite.Core\Impl\Transactions\TransactionImpl.cs:line > > > 460 at System.Threading.Tasks.Task.Execute() --JavaException ------- > > > Stderr: ------- Test started: > > > CacheAbstractTransactionalTest.TestTxStateAndExceptions Test finished= : > > > CacheAbstractTransactionalTest.TestTxStateAndExceptions > > > -- > > > Nikolay Izhikov > > > NIzhikov.dev@gmail.com > > > > > > > > > -- > Nikolay Izhikov > NIzhikov.dev@gmail.com > --001a114cb1b8958f80055526ef8e--