2.7 SDK - `Ping` always returns `OK` for non-ssl connection regardless of a server state

I’m using the Ping api in my healthcheck process and it seems that it always returns ok for every node even if the node has become unavailable. This happens only when UseSsl is false, when SslConnection is used then the unavailable node returned with Error state in the ping report.

Could someone please help to determine if it’s a misconfiguration on my side or probably this is a known issue?

Seems like Send of MultiplexingConnection never throws (HandleDisconnect just logs the exception), but Ping sets state of the endpoint in response to the exception occurred.

Does someone have any thoughts? Seems to me like we can’t rely on the Ping in the 2.7 .net SDK

@eugene-shcherbo -

It should work; which specific version are you using? If not the latest (2.7.26), can you try the latest? Can you provide a simple example and we will try to recreate?

Jeff

Hello @jmorris , thank you for your reply.

I’m using the latest version (2.7.26). Here is an example what I’m doing and what steps I do to reproduce it:

 (1)  IBucket bucket = _factory.GetBucket(_bucketType);
      IPingReport report = bucket.Ping(ServiceType.KeyValue);

     foreach (var serviceName in report.Services.Keys)
     {
(2)    var servicePingResults = report.Services[serviceName].ToList();

(3)    foreach (IEndpointDiagnostics servicePingResult in servicePingResults)
       {
            if (servicePingResult.State != ServiceState.Ok)
            {
                 // Never gets here
            }
       }
     }

Note: list items below are related to (1), (2) and (3) labels in the code

  1. Allow the SDK to bootstrap (under the hood the factory just calls Cluster.OpenBucket)
  2. Then before really pinging the cb nodes I simulate response timeout by blocking connections to the nodes
  3. After some time the execution continues in point (3) and servicePingResult has Ok state.