canonical / identity-platform-admin-ui

Admin UI for the Canonical identity broker and identity provider solution
Other
6 stars 4 forks source link

Evaluate how to deal with network or service errors when removing a role in the background via goroutines #217

Closed shipperizer closed 6 months ago

shipperizer commented 6 months ago

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
}
"""

_Originally posted by @nsklikas in https://github.com/canonical/identity-platform-admin-ui/pull/189#discussion_r1525156365_

syncronize-issues-to-jira[bot] commented 6 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-726.

This message was autogenerated