Set Permissions Command Returns Before Actual Permission Is Given? #14273
-
In my parallel application tests, I create a new vhost and a user for each test like this: vhostName := "test_" + uuid.New().String()
_, _, err := p.container.Exec(ctx, []string{
"rabbitmqctl", "add_vhost", vhostName,
})
if err != nil {
return "", nil, err
}
_, _, err = p.container.Exec(ctx, []string{
"rabbitmqctl", "set_permissions", "-p", vhostName, "guest", ".*", ".*", ".*",
})
if err != nil {
return "", nil, err
} Not always, but once in a while, when the receiver end tries to connect to the vhost, I get the error Seems like a timing issue. Either the command doesn't wait for the permission to create, or the auth backend doesn't immediately update it's permissions. If needed, I can create a script to replicate the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@mkadirtan many CLI operations are asynchronous. Schema (including permissions) operations specifically must be replicated to the entire cluster, which takes time. This is more obvious in the cases of definition imports, those can take seconds or even minutes, depending on how many virtual and queues/streams, and their replicas, there are to start. The issue here is that you assume everything in a distributed system to happen synchronously. |
Beta Was this translation helpful? Give feedback.
@mkadirtan many CLI operations are asynchronous. Schema (including permissions) operations specifically must be replicated to the entire cluster, which takes time.
This is more obvious in the cases of definition imports, those can take seconds or even minutes, depending on how many virtual and queues/streams, and their replicas, there are to start.
The issue here is that you assume everything in a distributed system to happen synchronously.