Skip to content

Reduce duplication when using multiple Notifiers #2760

@Swatinem

Description

@Swatinem

As you can see in this trace
each notifier instance is doing a bunch of duplicated work:

Image

  • It is re-requesting a github token over and over again, adding to our rate limiting problem
  • It is querying (presumably the same) Commit over and over again
  • The SELECT/INSERT of the commit_notifications could most likely be optimized by batching across all the various status notifications to be emitted
  • POST-ing the notifications to github should ideally happen in a batch (if the API allows it), instead of doing it one-by-one

Another optimization opportunity:
We have a redis GET immediately followed by SETEX is likely some form of cache. However it has the following problems:

  • GET with an immediate SETEX indicates a cache miss, so the cache might be ineffective
  • There is no visible gap / span in between the GET and SETEX, so whatever operation is being cached is likely very fast and does not need caching in the first place.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions