mozilla-releng / balrog

Mozilla's Update Server
http://mozilla-balrog.readthedocs.io/en/latest/index.html
Mozilla Public License 2.0
100 stars 148 forks source link

release v2 page in the admin ui is very slow #2995

Open jcristau opened 1 year ago

jcristau commented 1 year ago

Going to any release page in the admin ui, e.g. https://balrog.services.mozilla.com/releases/Firefox-mozilla-central-nightly-latest/v2, makes a request to https://aus4-admin.mozilla.org/api/v2/releases, which takes forever (about 30s for me). It seems wasteful to query the entire list of releases here...

I'm not sure whether this is entirely an UI problem or if it requires new API to fix.

ademolaomosanya commented 1 year ago

i would love to work on this issue kindly assign me

jcristau commented 1 year ago

Relatedly, https://balrog.services.mozilla.com/releases/ also makes a request to the releases list, which makes more sense, but which I'm seeing time out after 1 minute, and return 502.

gabrielBusta commented 1 year ago

I don't think this needs API changes. I should be possible to pass the release name to the endpoint I think? (it's displayed at the top of the page)

https://aus4-admin.mozilla.org/api/v2/releases/Firefox-mozilla-central-nightly-latest

jcristau commented 1 year ago

The UI also does that request for the specific release's contents, but it gets some extra metadata from the "give me all releases" endpoint.

gabrielBusta commented 1 year ago

@ademolaomosanya are you applying for outreachy?

gabrielBusta commented 1 year ago

We are letting applicants work on whatever issues are available, and not worry about being assigned to things (in part because there's more contributors than issues.) The experience is valuable to everyone (even if an applicant's pull-request is not the one that ends up merged.)

bhearsum commented 1 year ago

Just for the record, I'm not sure this is a frontend issue, at least not exclusively. There may be cases where we can avoid hitting this endpoint altogether, but the root problem is that the /api/v2/release is incredibly slow.

ademolaomosanya commented 1 year ago

@ademolaomosanya are you applying for outreachy?

yes

bhearsum commented 1 year ago

One factor here is that we're never started removing stale releases from the v2 table, like we do for v1. Doing that would go a long way to speeding this up.

One hitch here is that we'll want to make sure we remove any associated data from GCS as well (which is where the actual release blobs are stored for v2 releases). This is likely to involve some manual GCS endpoint manipulation, as the db.py classes will not remove any data from it.