-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A private role with no users breaks /api/roles + /api/roles times out #19654
Comments
|
@cat-bro: what did you update? The type of the role that did not have an association? (I can't reproduce the api timeout yet) |
Thanks @jdavcs. For that one private role with no user_role_associations, I changed deleted to 't', then type to 'sharing'. Galaxy Australia has about 40K users. The timeout with /api/roles does not occur on Galaxy Main for an admin user? How can I check how long the query is taking when that page loads? |
Reproduced the timeout. I know what's causing it and I know how to fix it. It's a 24.2 performance bug. |
It's a 2n+1 query problem. It stems from the change we made in 24.2 decoupling user emails and private role names. The unintended consequence (those are always unintended!) is that for 40K users you'll get around 80K select queries hitting the database (the exact number depends on what other roles you have and which user records are cached by sqlalchemy... but it's terrible whatever those are). I'm working on a fix. |
On release_24.2 following our update, https://usegalaxy.org.au/api/roles leads to 'Internal Server Error'.
Stack trace ends in
Did not find exactly one user for private role <galaxy.model.Role(1) at 0x7f36a0e1fa30>
- I'll add this as a comment because it's long.At first we were looking for a role with more than one user_role_association, then Nuwan worked out that it could be a role with no user_role_assocation - we found this and updated its type.
We think this might have solved the problem but it's not clear because the api now times out when loading. Setting
?limit=
or?page=
makes no differenceThe text was updated successfully, but these errors were encountered: