Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/22928
EE MR for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8336