Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1387818424 for ; Sat, 21 Nov 2015 02:01:42 +0000 (UTC) Received: (qmail 69164 invoked by uid 500); 21 Nov 2015 02:01:42 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 69060 invoked by uid 500); 21 Nov 2015 02:01:41 -0000 Mailing-List: contact commits-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 commits@ignite.apache.org Received: (qmail 68605 invoked by uid 99); 21 Nov 2015 02:01:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Nov 2015 02:01:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA7B5E099B; Sat, 21 Nov 2015 02:01:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Sat, 21 Nov 2015 02:02:18 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [40/50] [abbrv] ignite git commit: IGNITE-1966 .Net: Fixed handle leak during partitioned scan query. IGNITE-1966 .Net: Fixed handle leak during partitioned scan query. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9c717855 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9c717855 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9c717855 Branch: refs/heads/ignite-1753-1282 Commit: 9c7178557a7dde74fec0a709e8a574ecae0c6930 Parents: 911ca9d Author: vozerov-gridgain Authored: Fri Nov 20 14:32:27 2015 +0300 Committer: vozerov-gridgain Committed: Fri Nov 20 14:32:27 2015 +0300 ---------------------------------------------------------------------- .../processors/platform/cache/PlatformCache.java | 9 ++++----- .../Cache/CacheTestAsyncWrapper.cs | 1 - .../Cache/Query/CacheQueriesTest.cs | 2 -- .../Apache.Ignite.Core/Cache/Query/ScanQuery.cs | 14 +------------- .../Impl/Cache/CacheEntryFilterHolder.cs | 15 --------------- .../Apache.Ignite.Core/Impl/Cache/CacheImpl.cs | 15 ++------------- .../Impl/Unmanaged/UnmanagedCallbacks.cs | 2 +- 7 files changed, 8 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java index 6ec52d6..5943440 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java @@ -36,15 +36,14 @@ import org.apache.ignite.internal.processors.cache.IgniteCacheProxy; import org.apache.ignite.internal.processors.cache.query.QueryCursorEx; import org.apache.ignite.internal.processors.platform.PlatformAbstractTarget; import org.apache.ignite.internal.processors.platform.PlatformContext; +import org.apache.ignite.internal.processors.platform.PlatformNativeException; import org.apache.ignite.internal.processors.platform.cache.query.PlatformContinuousQuery; import org.apache.ignite.internal.processors.platform.cache.query.PlatformFieldsQueryCursor; import org.apache.ignite.internal.processors.platform.cache.query.PlatformQueryCursor; -import org.apache.ignite.internal.processors.platform.PlatformNativeException; import org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils; import org.apache.ignite.internal.processors.platform.utils.PlatformUtils; import org.apache.ignite.internal.util.GridConcurrentFactory; import org.apache.ignite.internal.util.typedef.C1; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteFuture; import org.jetbrains.annotations.Nullable; @@ -373,13 +372,13 @@ public class PlatformCache extends PlatformAbstractTarget { /** * Loads cache via localLoadCache or loadCache. */ - private void loadCache0(BinaryRawReaderEx reader, boolean loc) throws IgniteCheckedException { + private void loadCache0(BinaryRawReaderEx reader, boolean loc) { PlatformCacheEntryFilter filter = null; Object pred = reader.readObjectDetached(); if (pred != null) - filter = platformCtx.createCacheEntryFilter(pred, reader.readLong()); + filter = platformCtx.createCacheEntryFilter(pred, 0); Object[] args = reader.readObjectArray(); @@ -955,7 +954,7 @@ public class PlatformCache extends PlatformAbstractTarget { Object pred = reader.readObjectDetached(); if (pred != null) - qry.setFilter(platformCtx.createCacheEntryFilter(pred, reader.readLong())); + qry.setFilter(platformCtx.createCacheEntryFilter(pred, 0)); qry.setLocal(loc); http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs index 430272f..33c9f11 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs @@ -26,7 +26,6 @@ namespace Apache.Ignite.Core.Tests.Cache using Apache.Ignite.Core.Cache.Expiry; using Apache.Ignite.Core.Cache.Query; using Apache.Ignite.Core.Cache.Query.Continuous; - using Apache.Ignite.Core.Common; /// /// Wraps IGridCache implementation to simplify async mode testing. http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs index 411ef05..08a98f6 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs @@ -565,7 +565,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query /// Check scan query with partitions. /// [Test] - [Ignore("IGNITE-1012")] public void TestScanQueryPartitions([Values(true, false)] bool loc) { CheckScanQueryPartitions(MaxItemCnt, loc, false); @@ -575,7 +574,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query /// Check scan query with partitions in binary mode. /// [Test] - [Ignore("IGNITE-1012")] public void TestScanQueryPartitionsBinary([Values(true, false)] bool loc) { CheckScanQueryPartitions(MaxItemCnt, loc, true); http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs index 12fb363..2c9cf35 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs @@ -17,7 +17,6 @@ namespace Apache.Ignite.Core.Cache.Query { - using System; using Apache.Ignite.Core.Impl.Binary; using Apache.Ignite.Core.Impl.Cache; @@ -64,18 +63,7 @@ namespace Apache.Ignite.Core.Cache.Query var holder = new CacheEntryFilterHolder(Filter, (key, val) => Filter.Invoke( new CacheEntry((TK) key, (TV) val)), writer.Marshaller, keepBinary); - try - { - writer.WriteObject(holder); - } - catch (Exception) - { - writer.Marshaller.Ignite.HandleRegistry.Release(holder.Handle); - - throw; - } - - writer.WriteLong(holder.Handle); + writer.WriteObject(holder); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs index 0963145..4487c59 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs @@ -42,9 +42,6 @@ namespace Apache.Ignite.Core.Impl.Cache /** Grid. */ private readonly Marshaller _marsh; - /** Handle. */ - private readonly long _handle; - /// /// Initializes a new instance of the class. /// @@ -63,16 +60,6 @@ namespace Apache.Ignite.Core.Impl.Cache _invoker = invoker; _marsh = marsh; _keepBinary = keepBinary; - - _handle = marsh.Ignite.HandleRegistry.Allocate(this); - } - - /// - /// Gets the handle. - /// - public long Handle - { - get { return _handle; } } /// @@ -112,8 +99,6 @@ namespace Apache.Ignite.Core.Impl.Cache _marsh = reader0.Marshaller; _invoker = GetInvoker(_pred); - - _handle = _marsh.Ignite.HandleRegistry.Allocate(this); } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs index b1870d7..262ff12 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs @@ -270,21 +270,10 @@ namespace Apache.Ignite.Core.Impl.Cache { if (p != null) { - var p0 = new CacheEntryFilterHolder(p, (k, v) => p.Invoke(new CacheEntry((TK)k, (TV)v)), + var p0 = new CacheEntryFilterHolder(p, (k, v) => p.Invoke(new CacheEntry((TK) k, (TV) v)), Marshaller, IsKeepBinary); - try - { - writer.WriteObject(p0); - } - catch (Exception) - { - writer.Marshaller.Ignite.HandleRegistry.Release(p0.Handle); - - throw; - } - - writer.WriteLong(p0.Handle); + writer.WriteObject(p0); } else writer.WriteObject(null); http://git-wip-us.apache.org/repos/asf/ignite/blob/9c717855/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs index 98ea106..e554cfc 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs @@ -313,7 +313,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged private long CacheEntryFilterCreate(void* target, long memPtr) { - return SafeCall(() => CacheEntryFilterHolder.CreateInstance(memPtr, _ignite).Handle); + return SafeCall(() => _handleRegistry.Allocate(CacheEntryFilterHolder.CreateInstance(memPtr, _ignite))); } private int CacheEntryFilterApply(void* target, long objPtr, long memPtr)