System hooks are fired twice upon repository updates

Noticed while investigating https://gitlab.com/gitlab-com/production/issues/431.

We run a system hook here upon a push:

  1. https://gitlab.com/gitlab-org/gitlab-ce/blob/382b6dabd96e8966386729d82854b899ad4ce894/app/services/git_push_service.rb#L143

Then we run it again here:

  1. https://gitlab.com/gitlab-org/gitlab-ce/blob/382b6dabd96e8966386729d82854b899ad4ce894/app/services/git_push_service.rb#L144
  2. https://gitlab.com/gitlab-org/gitlab-ce/blob/382b6dabd96e8966386729d82854b899ad4ce894/app/models/project.rb#L1192

This can lead to unnecessary memory usage and add to slow Redis performance.

Edited Aug 21, 2018 by Stan Hu
Assignee Loading
Time tracking Loading