current implementation of background tasks and concurrency for removing roles and listing permissions is not scaleable
a new solution should be drafted to deal with the loose goroutines and the potential limit in file descriptors on mid to heavy load
Perhaps it is an unrealistic case, but I am a little worried that this may error if too many permissions are returned. I mean that openfga chooses not to return the permissions all at once, it is possible that it will not be able to handle them all at once either. In the API docs there is no mention of a limit, but I think that we should test it.
Disregard this if it does not make sense or leave a TODO to look into it in the future.
If this could cause an issue we could create a go routine for deleting the permissions for every continuation token we get, eg:
"""
for {
// Get the permissions using the continuation token
permissions, error := getPermissions(continuationToken)
// Delete permissions without blocking
go deletePermissions(permissions)
cToken = permissions.ContinuationToken
if cToken == "" {
break
}
// wait for all routines to return
}
"""
current implementation of background tasks and concurrency for removing roles and listing permissions is not scaleable
a new solution should be drafted to deal with the loose goroutines and the potential limit in file descriptors on mid to heavy load
_Originally posted by @nsklikas in https://github.com/canonical/identity-platform-admin-ui/pull/189#discussion_r1525156365_