#99 Use dogpile.cache for Errata.advisories_from_event to make BrewSignRPMEvents handling faster.
Merged by jkaluza. Opened by jkaluza.
jkaluza/freshmaker dogpile-errata  into  master

Download 99.patch

Freshmaker receives BrewSignRPMEvents in waves and it asks Errata tool for the same info everytime until the advisory is not signed. This PR caches that query for short time.

This makes sense to me.

Caching is always dangerous, so lemme think it through:

  • The only thing being cached here is the mapping between advisories and NVRs: what advisories an NVR is a part of.
  • That will only change when an advisory is in the NEW_FILES state. That is the only state where NVRs can change.
  • We only look to do work here when the advisory is in the ON_QE state.

I guess it is possible that an advisory could add an nvr, and it could transition to the ON_QE state and get signed within 10 seconds.... but pretty unlikely.

:+1:

Yeah, note that in the production (not talking about CI rebuilds, but the first deployment we plan), we will most likely skip this handler anyway, because we are going to rebuild once the advisory hits REL_PREP. This is handled by different handler which doesn't do any caching.

LGTM except that you probably need to add python-dogpile-cache in the freshmaker.spec file.

Pull-Request has been merged by jkaluza

Metadata