goczmq
goczmq copied to clipboard
newChanneler: unsafe generation of inproc address
func newChanneler(sockType int, endpoints string, subscribe []string, options []SockOption) *Channeler {
...
c := &Channeler{
id: rand.Int63(),
...
}
c.commandAddr = fmt.Sprintf("inproc://actorcontrol%d", c.id)
c.proxyAddr = fmt.Sprintf("inproc://proxy%d", c.id)
...
}
If very unlucky, two different instances of Channeler may have the exact same internal inproc address.
I would suggest to get a new c.id
from an uuid string instead of rand.Int63()
integer