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

Setting WorkerLimit in QueueOptions throws a nil pointer while using a Memqueue #176

Open
ericschmar opened this issue Apr 5, 2022 · 1 comment

Comments

@ericschmar
Copy link

Setting the Worker Limit to anything above 0 throws a nil pointer when using a memqueue.

My Setup:

	qf                             = memqueue.NewFactory()
	MessageQueue                   = qf.RegisterQueue(&taskq.QueueOptions{
		Name:            "pipeline-worker",
		MinNumWorker:    int32(runtime.NumCPU()),
		MaxNumWorker:    int32(runtime.NumCPU()),
		WorkerLimit:     5,
		ReservationSize: 1000000,
	})

The error in func (c *Client) obtain(ctx context.Context, key, value string, ttl time.Duration) (bool, error):

invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation]
Unable to propagate EXC_BAD_ACCESS signal to target process and panic (see https://github.com/go-delve/delve/issues/852)
Stack:
	0  0x0000000004c20e78 in github.com[/bsm/redislock.]()(*Client).obtain
	    at [/Users/schmar1/go/pkg/mod/github.com/bsm/redislock]()@v0.7.1[/redislock.go:97]()
	1  0x0000000004c2087f in github.com[/bsm/redislock.]()(*Client).Obtain
	    at [/Users/schmar1/go/pkg/mod/github.com/bsm/redislock]()@v0.7.1[/redislock.go:69]()
	2  0x0000000004c21438 in github.com[/bsm/redislock.Obtain]()
	    at [/Users/schmar1/go/pkg/mod/github.com/bsm/redislock]()@v0.7.1[/redislock.go:125]()
	3  0x0000000004c57552 in github.com[/vmihailenco/taskq/v3.]()(*Consumer).lockWorker
	    at [/Users/schmar1/go/pkg/mod/github.com/vmihailenco/taskq/v3]()@v3.2.8[/consumer.go:720]()
	4  0x0000000004c555d0 in github.com[/vmihailenco/taskq/v3.]()(*Consumer).worker
	    at [/Users/schmar1/go/pkg/mod/github.com/vmihailenco/taskq/v3]()@v3.2.8[/consumer.go:468]()
	5  0x0000000004c53cad in github.com[/vmihailenco/taskq/v3.]()(*Consumer).addWorker.func1
	    at [/Users/schmar1/go/pkg/mod/github.com/vmihailenco/taskq/v3]()@v3.2.8[/consumer.go:276]()
@lzap
Copy link

lzap commented Jan 3, 2023

Oh thank you for the bugreport, I was debugging this today and only then stumbled upon this issue. Removing the limit solves the problem :-)

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

No branches or pull requests

2 participants