Skip to content

Could you clarify timeouts for the Query? #413

@un000

Description

@un000

I don't understand how to manage timeouts for Query.
I got 20 retries with a sleep of 2 seconds and still issuing timeouts.

	cp := aerospike.NewClientPolicy()
	cp.Timeout = 5*time.Second
	cp.IdleTimeout = 10*time.Second


	qp := aerospike.NewQueryPolicy()
	qp.IncludeBinData = true
	qp.RecordQueueSize = 16 * 1024
	qp.FilterExpression = where
	qp.MaxRetries = 20
	qp.SleepBetweenRetries = 2*time.Second

	rs, err := c.client.Query(qp, statement)
	if err != nil {
		return fmt.Errorf("error executing Query: %w", err)
	}

	for result := range rs.Results() {
		if result.Err != nil {
			c.logger.Error("error scanning results", field.Error(err))     // < Timeout error here
			continue
		}

		if err := processFunc(result); err != nil {
			return fmt.Errorf("process func returned error: %w", err)
		}
	}

Per record processing time 150-250ms with 300 goroutines.
What should I change to increase timeout from aerospike, because after 20 retries ~ after 60-70 seconds of working the code fails?

AS: Aerospike Community Edition build 5.6.0.5
Client: v6.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions