goconcurrentqueue icon indicating copy to clipboard operation
goconcurrentqueue copied to clipboard

"empty queue and can't wait for next element because there are too many DequeueOrWaitForNextElement() waiting"

Open jfberry opened this issue 2 years ago • 1 comments

getting this error thrown... except I only have a maximum of 3 waiters

This is how I dequeue - is there a problem with timing out and rechecking? Does that leak something?

	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
	defer cancel()
	queuedElement, err := scoutQueue.DequeueOrWaitForNextElementContext(ctx)
	if err != nil {
		if err != context.DeadlineExceeded {
			log.Infof("SCOUT: Unexpected queue error: %s", err)
		}
		return nil
	}

jfberry avatar Nov 25 '23 07:11 jfberry

Hi @jfberry,

Could you please provide an example (golang playground) producing this error?

enriquebris avatar Nov 27 '23 15:11 enriquebris