aerospike-client-csharp icon indicating copy to clipboard operation
aerospike-client-csharp copied to clipboard

Aerospike under k8s using tcp proxy (null refrence)

Open thyn opened this issue 4 years ago • 1 comments

We are having issue when using aerospike through tcp proxy.

If we disable use alternate-access-address we are having null reference in client. The behavior is right. It can't find any working address. But, May be exception should be more informative?

Type: LogMessage
ExceptionDetails:
[0].Type: NullReferenceException
[0].Message: Object reference not set to an instance of an object.
[0].Source: AerospikeClient
[0].Method: FailOnApplicationError
[0].StackTrace:    at Aerospike.Client.AsyncCommand.FailOnApplicationError(AerospikeException ae)
   at Aerospike.Client.AsyncCommand.ExecuteCommand()
   at Aerospike.Client.AsyncCommand.ExecuteCore()
   at Aerospike.Client.AsyncCommand.ExecuteInline(SocketAsyncEventArgs e)
   at Aerospike.Client.AsyncCommandBlockingQueue.ScheduleCommand(AsyncCommand command)
   at Aerospike.Client.AsyncCluster.ScheduleCommandExecution(AsyncCommand command)
   at Aerospike.Client.AsyncCommand.Execute()
   at Aerospike.Client.AsyncClient.Put(WritePolicy policy, WriteListener listener, Key key, Bin[] bins)
  ...
[0].Data: 
Exceptions:
Exception: System.NullReferenceException
Error: Object reference not set to an instance of an object.
Source: AerospikeClient
Method: FailOnApplicationError
Data:
Stack:
   at Aerospike.Client.AsyncCommand.FailOnApplicationError(AerospikeException ae)
   at Aerospike.Client.AsyncCommand.ExecuteCommand()
   at Aerospike.Client.AsyncCommand.ExecuteCore()
   at Aerospike.Client.AsyncCommand.ExecuteInline(SocketAsyncEventArgs e)
   at Aerospike.Client.AsyncCommandBlockingQueue.ScheduleCommand(AsyncCommand command)
   at Aerospike.Client.AsyncCluster.ScheduleCommandExecution(AsyncCommand command)
   at Aerospike.Client.AsyncCommand.Execute()
   at Aerospike.Client.AsyncClient.Put(WritePolicy policy, WriteListener listener, Key key, Bin[] bins)
...)```


thyn avatar Feb 11 '21 06:02 thyn

I can generate a more informative error message if you tell me the exact line where the null reference occurred.

Is this it?

AsyncConnection.cs line 40:

	socket = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

BrianNichols avatar Feb 11 '21 19:02 BrianNichols