hazelcast / hazelcast-csharp-client Goto Github PK
View Code? Open in Web Editor NEWHazelcast .NET Client
Home Page: https://hazelcast.com/clients/dotnet/
License: Apache License 2.0
Hazelcast .NET Client
Home Page: https://hazelcast.com/clients/dotnet/
License: Apache License 2.0
The ReadObject and WriteObject methods within the SerializationService class perform a null check on the object in question by either doing a ReadBoolean to determine if the object is null or a WriteBoolean to record the object as null.
ReadObject (C#)
try
{
var isNull = input.ReadBoolean();
if (isNull)
{
return default(T);
}
....
WriteObject (C#)
var isNull = obj == null;
try
{
output.WriteBoolean(isNull);
if (isNull)
{
return;
}
var serializer = SerializerFor(obj);
output.WriteInt(serializer.GetTypeId());
serializer.Write(output, obj);
}
catch (Exception e)
{
throw HandleException(e);
}
The Java equivalents readObject and writeObject in the AbstractSerializationService class do not read or write any boolean from the stream to check for "nullness". The result of this is that any stream that utilizes these methods will fail because the C# client reads/writes one extra byte (for the "nullness" boolean). This causes reading and writing to fail. A quick check on the audit of both serialization service classes shows that the C# client has always done this and the Java equivalent hasn't done this, meaning these methods would have never worked. Updated: According to @cangencer this was changed in 3.5.5. I'm very new to Hazelcast (and C#/.NET itself) as well as Github (go easy on me :)), but can anyone confirm that my findings are indeed an issue? Removing these read/write boolean calls allows me to utilizes these methods.
Here are the Java equivalents to the above:
readObject
public final <T> T readObject(final ObjectDataInput in) {
try {
final int typeId = in.readInt();
final SerializerAdapter serializer = serializerFor(typeId);
if (serializer == null) {
if (active) {
throw newHazelcastSerializationException(typeId);
}
throw new HazelcastInstanceNotActiveException();
}
Object obj = serializer.read(in);
if (managedContext != null) {
obj = managedContext.initialize(obj);
}
return (T) obj;
} catch (Throwable e) {
throw handleException(e);
}
}
writeObject
@Override
public final void writeObject(final ObjectDataOutput out, final Object obj) {
if (obj instanceof Data) {
throw new HazelcastSerializationException(
"Cannot write a Data instance! " + "Use #writeData(ObjectDataOutput out, Data data) instead.");
}
try {
SerializerAdapter serializer = serializerFor(obj);
out.writeInt(serializer.getTypeId());
serializer.write(out, obj);
} catch (Throwable e) {
throw handleException(e);
}
}
Hello
If I start a dotnet client prior to any hazelcast node, then start an hazelcast instance, the client connects but never completes the initialization and hangs forever.
The code used on the dotnet side:
var config = new ClientConfig();
config.GetNetworkConfig().AddAddress(new[] { "127.0.0.1:5701" });
var client = HazelcastClient.NewHazelcastClient(config); // stay here for ever
To start an hazelcast instance I simply use the following command:
start java -jar hazelcast-3.6-RC2-20151203.155725-88.jar
The logs that I get on the dotnet side:
22:19:03.772 [FINEST] - [:8] Hazelcast.Client.Spi.ClientClusterService: Trying to connect to Address[127.0.0.1]:5701
22:19:03.772 [FINEST] - [:8] Hazelcast.Client.Connection.IClientConnectionManager: Creating new connection for Address[127.0.0.1]:5701 with id 0
22:19:03.784 [FINEST] - [:8] Hazelcast.Client.Spi.ClientClusterService: Authenticating against the owner node
// nothing after that
Let me know if I have missed anything or if you need more information
Client related info and statistics for Management Center.
Hazelcast.Client.Test.ClientSSLTest.TestMapSSLEnabled_DoNotValidateName
MESSAGE:
System.InvalidOperationException : Unable to connect to any address in the config! The following addresses were tried:127.0.0.1:5701
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Spi.ClientClusterService.ConnectToOne() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientClusterService.cs:line 379
at Hazelcast.Client.Spi.ClientClusterService.ConnectToCluster() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientClusterService.cs:line 333
at Hazelcast.Client.Spi.ClientClusterService.Start() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientClusterService.cs:line 225
at Hazelcast.Client.HazelcastClient.Start() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClient.cs:line 427
at Hazelcast.Client.HazelcastClient.NewHazelcastClient(ClientConfig config) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClient.cs:line 329
at Hazelcast.Client.Test.ClientSSLTest.Setup(Boolean ssl, Boolean validateCertificateChain, Boolean validateCertificateName, String certificateName) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientSSLTest.cs:line 40
at Hazelcast.Client.Test.ClientSSLTest.TestMapSSLEnabled_DoNotValidateName() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientSSLTest.cs:line 74
Hazelcast.Client.Test.ClientSSLTest.TestMapSSLEnabled_validateName_validName
MESSAGE:
System.InvalidOperationException : Unable to connect to any address in the config! The following addresses were tried:127.0.0.1:5701
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Spi.ClientClusterService.ConnectToOne() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientClusterService.cs:line 379
at Hazelcast.Client.Spi.ClientClusterService.ConnectToCluster() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientClusterService.cs:line 333
at Hazelcast.Client.Spi.ClientClusterService.Start() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientClusterService.cs:line 225
at Hazelcast.Client.HazelcastClient.Start() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClient.cs:line 427
at Hazelcast.Client.HazelcastClient.NewHazelcastClient(ClientConfig config) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClient.cs:line 329
at Hazelcast.Client.Test.ClientSSLTest.Setup(Boolean ssl, Boolean validateCertificateChain, Boolean validateCertificateName, String certificateName) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientSSLTest.cs:line 40
at Hazelcast.Client.Test.ClientSSLTest.TestMapSSLEnabled_validateName_validName() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientSSLTest.cs:line 54
When a Hazelcast .NET 3.8.1 client connected to a cluster, members reports the connectivity as follows:
INFO: [192.168.56.1]:5701 [dev] [3.8.1] Received auth from Connection[id=1, /127.0.0.1:5701->/127.0.0.1:11255, endpoint=null, alive=true, type=CSHARP_CLIENT], successfully authenticated, principal : ClientPrincipal{uuid='81d52973-8480-441d-a2b2-c0a8aeb49fe6', ownerUuid='455b9a86-453b-480c-acaa-025e54fab2f8'}, owner connection : true, client version : 3.8.0
As it is seen, the client version seems as 3.8.0 which is 3.8.1 in real.
fixed by #117
When running a test which loads data in parallel, the following exception is thrown:
System.AggregateException : One or more errors occurred.
----> Hazelcast.IO.Serialization.HazelcastSerializationException : Class-id: 106 is already registered!
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
--HazelcastSerializationException
at Hazelcast.IO.Serialization.SerializationService.ToObject[T](Object object)
at Hazelcast.Client.Proxy.ClientMapProxy`2.Get(Object key)
When it is changed the parallel client down to be single threaded this issue does not arise.
An old bug in Java client fix should be ported in here too. The notion of failed-registration list is required.
Handle leaking occur when reconnecting to server
can be reproduced by continually trying to connect to a nonexisting server
ClientConfig HazelConfig = null;
IHazelcastInstance instance = null;
HazelConfig = new ClientConfig();
HazelConfig.GetNetworkConfig().AddAddress("10.10.10.123");
bool connected = false;
while (!connected)
{
try
{
Program.instance = HazelcastClient.NewHazelcastClient(Program.HazelConfig);
// ConnectToHazelcast();
connected = true;
}
catch (Exception)
{
}
}
Unhandled Exception:
System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
at (wrapper managed-to-native) System.Threading.Monitor:Exit (object)
at System.Threading.SemaphoreSlim.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00179] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/SemaphoreSlim.cs:425
at System.Collections.Concurrent.BlockingCollection`1[T].TryTakeWithNoTimeValidation (System.Collections.Concurrent.T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, System.Threading.CancellationTokenSource combinedTokenSource) [0x00076] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:712
at System.Collections.Concurrent.BlockingCollection`1[T].TryTake (System.Collections.Concurrent.T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00006] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:667
at System.Collections.Concurrent.BlockingCollection`1[T].Take () [0x00000] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:554
at Hazelcast.Client.Connection.ClientConnection.WriteQueueLoop () [0x0001e] in Hazelcast.Net/Hazelcast.Client.Connection/ClientConnection.cs:393
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/thread.cs:68
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:893
at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in /private/tmp/source-mono-4.4.0-c7sr1/bockbuild-mono-4.4.0-branch-c7sr1/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/thread.cs:105
https://hazelcast-l337.ci.cloudbees.com/job/csharp-client-pr-builder/270/
MESSAGE:
Hazelcast.Core.HazelcastException : Object reference not set to an instance of an object.
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Spi.ClientProxy.<>c__DisplayClass1`1.<InvokeAsync>b__0(Task`1 t) in c:\jenkins\ope-fs-root\workspace\csharp-client-pr-builder\Hazelcast.Net\Hazelcast.Client.Spi\ClientProxy.cs:line 77
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
update with regenerated client protocol codecs
Serialization service internal bufferPool leaks due to strong Thread references.
Reported by #115
.Net client has a hard coded 250 sec of invocation timeout. This prevents submitting long running operations such as executeOnKey or complicated predicate queries.
After the timeout hit, waiting invocation responded by TimeoutException. But the server side continue to execute and respond the actual result. On this case;
Received an unhandled exception from a task!: System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
at System.Threading.Tasks.Task`1.set_Result(TResult value)
at Hazelcast.Client.Spi.SettableFuture`1.set_Result(T value)
at Hazelcast.Client.Spi.ClientInvocationService.HandleResponseMessage(IClientMessage response)
at Hazelcast.Client.Spi.ClientInvocationService.<>c__DisplayClass4.<HandleClientMessage>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Java client has no similar timeout and waits the server side forever. The trivial solution is to implement the same behaviour.
Are there plans to support this? It would be awesome to use Hazelcast with Windows IoT for distributed computing. I've pulled down a Git copy of it, but it is a lot of stuff for me to learn and then convert over.
Map type listeners are not inline with Java client implementation improvements.
An issue found in java client.
hazelcast/hazelcast#6608
Needs to be checked if same issue is here.
There seems to be an issue using the .NET Client with Windows to Linux server, works with a Windows server. Could be a big-endian / little-endian difference.
Tech-stack:
.Net version 4.5
· Windows version: Windows 7 (for client) Windows server 2012 (if I am running Hazelcast server on Windpows)
· Hazelcast client version 3.7.1
· Linux version: Debian GNU/Linux8 (jessie)
· Hazelcast server version : 3.7.5
· Java :
o openjdk version "1.8.0_111"
o OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
o OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
No further details yet...
MESSAGE:
SetUp : Hazelcast.Core.HazelcastException : com.hazelcast.spi.exception.RetryableIOException: Packet not send to -> Address[172.30.0.171]:5702
----> Hazelcast.Core.HazelcastException : Exception of type 'Hazelcast.Core.HazelcastException' was thrown.
TearDown : Hazelcast.Core.HazelcastInstanceNotActiveException : Hazelcast instance is not active!
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Spi.ProxyManager.Initialize(ClientProxy clientProxy) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ProxyManager.cs:line 287
at Hazelcast.Client.Spi.ProxyManager.InitializeWithRetry(ClientProxy clientProxy) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ProxyManager.cs:line 315
at Hazelcast.Client.Spi.ProxyManager.GetOrCreateProxy[T](String service, String id) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ProxyManager.cs:line 129
at Hazelcast.Client.HazelcastClient.GetDistributedObject[T](String serviceName, String name) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClient.cs:line 236
at Hazelcast.Client.HazelcastClient.GetQueue[T](String name) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClient.cs:line 115
at Hazelcast.Client.HazelcastClientProxy.GetQueue[T](String name) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client\HazelcastClientProxy.cs:line 40
at Hazelcast.Client.Test.ClientQueueTest.Init() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientQueueTest.cs:line 35
--HazelcastException
--TearDown
at Hazelcast.Client.Spi.ClientProxy.Invoke(IClientMessage request, Object key) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientProxy.cs:line 163
at Hazelcast.Client.Proxy.ClientQueueProxy`1.Invoke(IClientMessage request) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientQueueProxy.cs:line 301
at Hazelcast.Client.Spi.ClientProxy.Invoke[T](IClientMessage request, Func`2 decodeResponse) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientProxy.cs:line 186
at Hazelcast.Client.Proxy.ClientQueueProxy`1.Clear() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientQueueProxy.cs:line 285
at Hazelcast.Client.Test.ClientQueueTest.Destroy() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientQueueTest.cs:line 42
writing from c#
var map1 = client.GetMap<string, List<int>>("listTest");
map1.Set("vikTest", new List<int> {1, 2});
can’t read it from java
Exception in thread "main" com.hazelcast.nio.serialization.HazelcastSerializationException: There is no suitable de-serializer for type -110. This exception is likely to be caused by differences in the serialization configuration between members or between clients and members.
but it should use type -26
which is List
When using a PagingPredicate with Map.EntrySet() (with returning some entries), the following exception is thrown at the client:
at System.Linq.Enumerable.<CastIterator>d__94`1.MoveNext()
at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection)
at Hazelcast.Client.Proxy.ClientMapProxy`2.EntrySetWithPagingPredicate(PagingPredicate pagingPredicate)
at Hazelcast.Client.Proxy.ClientMapProxy`2.EntrySet(IPredicate predicate)
at ConsoleApplication3.Program.Main(String[] args) in c:\Users\Alparslan\Documents\Visual Studio 2013\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:line 32
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
The reproducer code is as follows:
var map = client.GetMap<int, int>("testMap");
var size = map.EntrySet(new PagingPredicate(3)).Count;
Map.KeySet() works smoothly. Client version is 3.8.2.
MESSAGE:
Expected: "value1"
But was: null
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Test.ClientMapTest.TestAsyncPutWithTtl() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientMapTest.cs:line 190
This is what we do on the server. We need to provide the same level of version information on the clients.
INFO: [10.0.0.2]:5701 [dev] [3.6-EA2] Hazelcast 3.6-EA2 (20151125 - 8af85c5) starting at Address[10.0.0.2]:5701
See https://github.com/hazelcast/hazelcast/releases. You will see it corresponds to EA2
Hello,
Thanks for having open sourced this csharp client.
I have done some testing and I have come to the conclusion that the current csharp client can only connect to an hazelcast cluster using a 3.6-RC snapshot version. Otherwise using Hazelcast 3.5, the client hangs for ever.
Am I missing something?
Regards
A separate internal thread pool should be used for handling incoming messages, rather than the default thread pool.
If the user creates a very large number of tasks (default thread pool size is 1024) which perform blocking operations on Hazelcast client, this can cause a deadlock as the Hazelcast operations also need a thread from the thread pool to process the response.
When I do:
hzClient.getMap("map").Set("key", new byte[] {1,2,3});
It doest not work and my application hang on
Apply the changes in hazelcast/hazelcast#6555 and hazelcast/hazelcast#6480.
There exists an unhandled ThreadInterruptedException on I/O writer thread. Here is the stacktrace of the exception:
Exception Info: System.Threading.ThreadInterruptedException
Stack:
at System.Threading.Monitor.ReliableEnter(System.Object, Boolean ByRef)
at System.Threading.Monitor.Enter(System.Object, Boolean ByRef)
at System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean, Boolean)
at System.Resources.RuntimeResourceSet.GetString(System.String, Boolean)
at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
at System.SR.GetString(System.String)
at System.Collections.Concurrent.BlockingCollection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Take()
at Hazelcast.Client.Connection.ClientConnection.WriteQueueLoop()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Hello
I have tried to share some data between a java process and a dotnet one using a map.
Using a key of type double on both side of Integer/Int32 , I get serialization errors on the dotnet side with the following message "There is no suitable de-serializer for type 0".
I guess this might be related to dotnet "struct" types. I could wrap my key in a IPortable class but this does not seems to be a memory efficient solution...
Let me know if I have missed something in the doc
Regards
I have tried to test a failover scenario with hazelcast 3.6 and the csharp client (3.6 as well) and I think I might found a bug.
I have written a tiny csharp program that instantiate an hazelcast client that listens on a topic and send messages to the same topic within a loop. The client can connect to two different hazelcast instances.
The test scenario is quite simple :
After a few iterations my csharp client crashes while trying to send messages while switching from one instance to the other one.
I have also written the very same program in java - I have not succeed to reproduce the issue with the java version.
Below my csharp code:
static void Main(string[] args)
{
Environment.SetEnvironmentVariable("hazelcast.logging.level", "All");
Environment.SetEnvironmentVariable("hazelcast.logging.type", "console");
var config = new ClientConfig();
config.GetNetworkConfig().SetConnectionAttemptLimit(10);
config.GetNetworkConfig().AddAddress(new[] { "127.0.0.1:5701", "127.0.0.1:5702" });
var client = HazelcastClient.NewHazelcastClient(config);
var topic = client.GetTopic<string>("backplane");
topic.AddMessageListener(msg => Console.Out.WriteLine("Received msg: " + msg.GetMessageObject()));
IAtomicLong counter = client.GetAtomicLong("counter");
for (int i = 0; i < 1000; i++)
{
var sqn = counter.IncrementAndGet();
Console.Out.WriteLine("Hello " + i + " " + sqn);
Thread.Sleep(1000);
topic.Publish(i + " hello " + DateTime.Now);
}
}
I start my hazelcast instances with the default config - i.e. with the following command line:
start java -jar hazelcast-3.6.jar
Below an exception stacktrace I have got with the scenario described above:
Hazelcast.Client.Spi.TargetDisconnectedException was unhandled
_HResult=-2146233087
_message=Target[Address[192.168.0.15]:5701] disconnected.
HResult=-2146233087
IsTransient=false
Message=Target[Address[192.168.0.15]:5701] disconnected.
Source=Hazelcast.Net
StackTrace:
à Hazelcast.Client.Spi.ClientProxy.Invoke(IClientMessage request, Object key)
à Hazelcast.Client.Proxy.ClientTopicProxy`1.Invoke(IClientMessage request)
à Hazelcast.Client.Proxy.ClientTopicProxy`1.Publish(T message)
à HzSource.Program.Main(String[] args) dans c:\work\dotnetsandbox\HzSandbox\HzSource\Program.cs:ligne 41
à System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException:
Let me know if you need more details
Regards
The lack of Properties breaks a huge number of features in the .net framework.
Is ReliableTopic in the plans for this client? If yes, approximately when? Cheers!
TestKeySetValues
MESSAGE:
Expected: 3
But was: 2
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Test.ClientTxnMapTest.TestKeySetValues() in c:\jenkins\ope-fs-root\workspace\csharp-client-maintenance\Hazelcast.Test\Hazelcast.Client.Test\ClientTxnMapTest.cs:line 130
TestPutGet
MESSAGE:
System.InvalidOperationException : Nested transactions are not allowed!
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Util.ExceptionUtil.Rethrow(Exception t) in c:\jenkins\ope-fs-root\workspace\csharp-client-maintenance\Hazelcast.Net\Hazelcast.Util\ExceptionUtil.cs:line 118
at Hazelcast.Client.Request.Transaction.TransactionProxy.Begin() in c:\jenkins\ope-fs-root\workspace\csharp-client-maintenance\Hazelcast.Net\Hazelcast.Client.Request.Transaction\TransactionProxy.cs:line 72
at Hazelcast.Client.Request.Transaction.TransactionContextProxy.BeginTransaction() in c:\jenkins\ope-fs-root\workspace\csharp-client-maintenance\Hazelcast.Net\Hazelcast.Client.Request.Transaction\TransactionContextProxy.cs:line 43
at Hazelcast.Client.Test.ClientTxnMapTest.TestPutGet() in c:\jenkins\ope-fs-root\workspace\csharp-client-maintenance\Hazelcast.Test\Hazelcast.Client.Test\ClientTxnMapTest.cs:line 40
https://hazelcast-l337.ci.cloudbees.com/view/Official%20Builds/job/csharp-client-maintenance/560/
Hello,
I am trying to create hazelcast dot net client.
While compiling the test project I am getting the below error:
Error 13 Friend access was granted to 'Hazelcast.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001004d81045a994968ac643918d7bbce405b2473471d8de6aed6bbffc0fe1874bfcabf3c0b437c6c5293a589bdcbe884c6d86934069b35deaf5ab2e770cbff41a20dd4014bb53e481c30bd3ead29437b02dec5916a717a4a2b4fd353e81238b89ae09e5ba0ab615c5fef7937aabab4e240c3dffe2b948047769eeb07f674589d0bb3', but the output assembly is named 'Hazelcast.Test, Version=3.8.0.0, Culture=neutral, PublicKeyToken=null'. Try adding a reference to 'Hazelcast.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001004d81045a994968ac643918d7bbce405b2473471d8de6aed6bbffc0fe1874bfcabf3c0b437c6c5293a589bdcbe884c6d86934069b35deaf5ab2e770cbff41a20dd4014bb53e481c30bd3ead29437b02dec5916a717a4a2b4fd353e81238b89ae09e5ba0ab615c5fef7937aabab4e240c3dffe2b948047769eeb07f674589d0bb3' or changing the output assembly name to match. d:Hazelcast.Net\bin\Debug\Hazelcast.Net.dll Hazelcast.Test
Also, I want to connect to the Hazelcast cache server, which password protected. Please let me know how to do this.
Thanks.
MESSAGE:
Hazelcast.Core.HazelcastException : Hazelcast instance is not active!
TearDown : Hazelcast.Core.HazelcastException : Hazelcast instance is not active!
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Spi.ClientProxy.Invoke(IClientMessage request, Object key) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientProxy.cs:line 163
at Hazelcast.Client.Proxy.ClientCountDownLatchProxy.Invoke(IClientMessage request) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientCountDownLatchProxy.cs:line 61
at Hazelcast.Client.Proxy.ClientCountDownLatchProxy.TrySetCount(Int32 count) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientCountDownLatchProxy.cs:line 55
at Hazelcast.Client.Test.ClientCountDownLatchTest.TestLatch() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientCountDownLatchTest.cs:line 46
--TearDown
at Hazelcast.Client.Spi.ClientProxy.Invoke(IClientMessage request, Object key) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientProxy.cs:line 163
at Hazelcast.Client.Proxy.ClientCountDownLatchProxy.Invoke(IClientMessage request) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientCountDownLatchProxy.cs:line 61
at Hazelcast.Client.Spi.ClientProxy.Destroy() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Spi\ClientProxy.cs:line 60
at Hazelcast.Client.Test.ClientCountDownLatchTest.Destroy() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientCountDownLatchTest.cs:line 35
MESSAGE:
Expected: 3
But was: 4
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Test.ClientDistributedObjectTest.TestGetDistributedObjects() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientDistributedObjectTest.cs:line 49
Exception like HazelcastException can be marked as Serializable to support containers some remote calls etc.
MESSAGE:
Could not verify assertion The partition list did not contain 2 partitions. after 60 seconds: NUnit.Framework.AssertionException: Expected: 2
But was: 1
at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
at NUnit.Framework.Assert.AreEqual(Int32 expected, Int32 actual)
at Hazelcast.Client.Test.HazelcastBaseTest.<AddNodeAndWait>b__2() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\HazelcastBaseTest.cs:line 105
at Hazelcast.Client.Test.TestSupport.AssertTrueEventually(Action asserAction, Int32 timeoutSeconds, String assertion) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\TestSupport.cs:line 83
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Test.TestSupport.AssertTrueEventually(Action asserAction, Int32 timeoutSeconds, String assertion) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\TestSupport.cs:line 92
at Hazelcast.Client.Test.HazelcastBaseTest.AddNodeAndWait() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\HazelcastBaseTest.cs:line 108
at Hazelcast.Client.Test.ClientPartitionTest.TestPartitionsUpdatedAfterNewNode() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientPartitionTest.cs:line 48
ClientConfig should provide away for setting property and values
ESSAGE:
An unexpected exception type was thrown
Expected: System.InvalidOperationException
but was: Hazelcast.Transaction.TransactionException : No transaction context found for txnId:559caf37-ff27-4962-aa99-e83e36ed347b
+++++++++++++++++++
STACK TRACE:
at Hazelcast.Client.Proxy.ClientTxnProxy.Invoke(IClientMessage request) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientTxnProxy.cs:line 98
at Hazelcast.Client.Proxy.ClientTxnProxy.Invoke[T](IClientMessage request, Func`2 decodeResponse) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientTxnProxy.cs:line 102
at Hazelcast.Client.Proxy.ClientTxnMapProxy`2.Put(TKey key, TValue value, Int64 ttl, TimeUnit timeunit) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientTxnMapProxy.cs:line 77
at Hazelcast.Client.Proxy.ClientTxnMapProxy`2.Put(TKey key, TValue value) in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Net\Hazelcast.Client.Proxy\ClientTxnMapProxy.cs:line 67
at Hazelcast.Client.Test.ClientRetryTest.ClientTransactionRetry() in c:\jenkins\ope-fs-root\workspace\csharp-client-master\Hazelcast.Test\Hazelcast.Client.Test\ClientRetryTest.cs:line 54
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.