Skip to content

If using RetryPolicy server errors are not propagated to user #1161

Closed
@mmatczuk

Description

What version of Cassandra are you using?

Any.

What version of Gocql are you using?

e48272f

What did you do?

package gocql

import "testing"

func TestErrorNotPropagated(t *testing.T) {
	cluster := createCluster()
	t.Logf("Using %T", cluster.RetryPolicy)

	session, err := cluster.CreateSession()
	if err != nil {
		t.Fatal(err)
	}
	defer session.Close()

	q := session.Query("BLA BLA BLA")
	if err := q.Exec(); err != nil {
		t.Log(err)
	}
	// e48272f
	// grr_test.go:7: Using *gocql.SimpleRetryPolicy
	// grr_test.go:17: gocql: no hosts available in the pool

	// 153a728
	// grr_test.go:7: Using *gocql.SimpleRetryPolicy
	// grr_test.go:17: line 1:0 no viable alternative at input 'BLA' ([BLA]...)
}

What did you expect to see?

Proper error form server:

line 1:0 no viable alternative at input 'BLA' ([BLA]...)

What did you see instead?

Wrong information that the pool is empty

gocql: no hosts available in the pool

With the changes introduced in e48272f, if using RetryPolicy user is not notified about server (or any other) errors.

cc @Zariel @annismckenzie @alourie

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions