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

cluster: Fix index out of range in removeNodesCopy #85

Merged
merged 1 commit into from Oct 16, 2015

Conversation

oldmantaiter
Copy link
Contributor

Ran into some issues where we would get an index out of range because
make() was given a length of zero.
Thus the first time nodeArray is accessed it threw an index out
of range panic.

It was only happening a few seconds after starting the cluster, so
there might be a bit more of an elegant solution but I have not had
time to take a deeper look into it.

Most recent stacktrace (using an older version of the library):

panic: runtime error: index out of range
goroutine 71 [running]:
github.com/aerospike/aerospike-client-go.(_Cluster).removeNodesCopy(0xc208
7d4080, 0xc2d2a6cee8, 0x1, 0x1)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:528 +0x54d
github.com/aerospike/aerospike-client-go.(_Cluster).removeNodes(0xc2087d40
80, 0xc2d2a6cee8, 0x1, 0x1)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:504 +0x256
github.com/aerospike/aerospike-client-go.(_Cluster).tend(0xc2087d4080, 0x0,
0x0)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:187 +0x413
github.com/aerospike/aerospike-client-go.(_Cluster).clusterBoss(0xc2087d4080)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:110 +0x206
created by github.com/aerospike/aerospike-client-go.NewCluster
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:91 +0x3fd

Ran into some issues where we would get an index out of range because
make() was given a length of zero.
Thus the first time nodeArray is accessed it threw an index out
of range panic.

It was only happening a few seconds after starting the cluster, so
there might be a bit more of an elegant solution but I have not had
time to take a deeper look into it.

Most recent stacktrace (using an older version of the library):

panic: runtime error: index out of range
goroutine 71 [running]:
github.com/aerospike/aerospike-client-go.(*Cluster).removeNodesCopy(0xc208
7d4080, 0xc2d2a6cee8, 0x1, 0x1)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:528 +0x54d
github.com/aerospike/aerospike-client-go.(*Cluster).removeNodes(0xc2087d40
80, 0xc2d2a6cee8, 0x1, 0x1)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:504 +0x256
github.com/aerospike/aerospike-client-go.(*Cluster).tend(0xc2087d4080, 0x0,
 0x0)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:187 +0x413
github.com/aerospike/aerospike-client-go.(*Cluster).clusterBoss(0xc2087d4080)
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:110 +0x206
created by github.com/aerospike/aerospike-client-go.NewCluster
/usr/go/src/github.com/aerospike/aerospike-client-go/cluster.go:91 +0x3fd
@khaf khaf merged commit 3185441 into aerospike:master Oct 16, 2015
@khaf
Copy link
Collaborator

khaf commented Oct 17, 2015

Thanks for the PR. Merged if the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants