[Bug]: The worker pool will panic with WithPreAlloc(true) #358
Labels
bug
Something isn't working
needs investigation
This issue or proposal needs some investigations
needs more info
waiting for response
waiting for the response from commenter
Actions I've taken before I'm here
What happened?
When creating worker pool with latest v2.11.1, regardless using multi pool or single pool.
The option
WithPreAlloc(true)
will cause panicruntime error: index out of range [0] with length 0
when call ReleaseWithTimeout() first, then callReboot
to reboot released pool.E.g.,
It happens on worker_loop_queue.go:70,
loopQueue.insert
method.Major version of ants
v2
Specific version of ants
v2.11.1
Operating system
Linux
OS version
Debian
Go version
go1.23.2
Relevant log output
Reproducer
How to Reproduce
Steps to reproduce the behavior:
Does this issue reproduce with the latest release?
It can reproduce with the latest release
The text was updated successfully, but these errors were encountered: