Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to Pool<T> class, load balancer detection and AsyncOperateWrite #142

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AerospikeClient/Async/AsyncOperateWrite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public AsyncOperateWrite(AsyncCluster cluster, RecordListener listener, Key key,
public AsyncOperateWrite(AsyncOperateWrite other)
: base(other)
{
this.listener = other.listener;
this.args = other.args;
}

Expand Down
5 changes: 4 additions & 1 deletion AerospikeClient/Cluster/NodeValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ private void ValidateAddress(Cluster cluster, IPAddress address, string tlsName,
// Disable load balancer detection for localhost.
detectLoadBalancer = false;
}

}

if (detectLoadBalancer)
{
// Seed may be load balancer with changing address. Determine real address.
addressCommand = (cluster.tlsPolicy != null) ?
cluster.useServicesAlternate ? "service-tls-alt" : "service-tls-std" :
Expand Down
2 changes: 1 addition & 1 deletion AerospikeClient/Cluster/Pool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public T PeekFirst()
return default;
}

return items[head];
return items[head == 0 ? items.Length - 1 : head - 1];
}
finally
{
Expand Down
Loading