You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the two word lists namesgenerator uses, it's only capable of generating <105 distinct names (and this has been trending downwards over time, as words get struck from the list for potentially causing offense). This implies that collisions are expected in most sets of just a few hundred random service names (math), causing intermittent failures in service creation. This has happened to me in an application creating many short-lived services, similar to the new Swarm Jobs feature, which I'd speculate might also be affected by this.
Elsewhere namesgenerator is used in a retry loop -- something similar seems to be needed for service names creation as well. Or, namesgenerator could be changed to add more entropy.
The text was updated successfully, but these errors were encountered:
I've actually been aware of this problem for some time. I remember someone getting mad at me for calling it a "birthday problem" because those words have a strong negative connotation in the field of security, but that's essentially what it is.
The difficulty with a retry loop is that each retry iteration would involve making a separate API call to Swarm. It's not all that disruptive, but under the current model, the place where names are generated (your snippet) is quite distant from the place where services are created.
For now, I've no intention of spending time working on this problem, so I'd recommend coming up with a naming scheme for your services, instead of leaving them anonymous and having a name generated.
OK, that's fair; hopefully leaving this github issue here will help somebody else seeing the intermittent "rpc error: code = Unknown desc = name conflicts with an existing object". It's the sort of problem that tends to only show up in production.
First, delighted to see the Mirantis blog post on continuing support for swarm mode! 馃帀馃嵕 @dperny
Here service.go uses the namesgenerator package to create a random service name if the caller did not specify one:
moby/daemon/cluster/convert/service.go
Lines 155 to 160 in 9fee52d
Based on the two word lists namesgenerator uses, it's only capable of generating <105 distinct names (and this has been trending downwards over time, as words get struck from the list for potentially causing offense). This implies that collisions are expected in most sets of just a few hundred random service names (math), causing intermittent failures in service creation. This has happened to me in an application creating many short-lived services, similar to the new Swarm Jobs feature, which I'd speculate might also be affected by this.
Elsewhere namesgenerator is used in a retry loop -- something similar seems to be needed for service names creation as well. Or, namesgenerator could be changed to add more entropy.
The text was updated successfully, but these errors were encountered: