Commit Graph

11 Commits

Author SHA1 Message Date
GitLab Bot f4251f2694 Add latest changes from gitlab-org/gitlab@master 2020-06-02 06:08:01 +00:00
GitLab Bot abe11a6a2c Add latest changes from gitlab-org/gitlab@master 2020-04-28 21:09:35 +00:00
Bob Van Landuyt 452bc36d60 Rework retry strategy for remote mirrors
**Prevention of running 2 simultaneous updates**

Instead of using `RemoteMirror#update_status` and raise an error if
it's already running to prevent the same mirror being updated at the
same time we now use `Gitlab::ExclusiveLease` for that.

When we fail to obtain a lease in 3 tries, 30 seconds apart, we bail
and reschedule. We'll reschedule faster for the protected branches.

If the mirror already ran since it was scheduled, the job will be
skipped.

**Error handling: Remote side**

When an update fails because of a `Gitlab::Git::CommandError`, we
won't track this error in sentry, this could be on the remote side:
for example when branches have diverged.

In this case, we'll try 3 times scheduled 1 or 5 minutes apart.

In between, the mirror is marked as "to_retry", the error would be
visible to the user when they visit the settings page.

After 3 tries we'll mark the mirror as failed and notify the user.

We won't track this error in sentry, as it's not likely we can help
it.

The next event that would trigger a new refresh.

**Error handling: our side**

If an unexpected error occurs, we mark the mirror as failed, but we'd
still retry the job based on the regular sidekiq retries with
backoff. Same as we used to

The error would be reported in sentry, since its likely we need to do
something about it.
2019-08-13 20:52:01 +00:00
Thong Kuah 85b29c1c2f Add frozen_string_literal to spec/services
Probably useful as we often move these files to "new" files.
2019-04-12 10:14:54 +12:00
Nick Thomas f1bc7b6eb5
SSH public-key authentication for push mirroring 2018-11-19 11:46:39 +00:00
Douglas Barbosa Alexandre 951144536a
Doesn't synchronize default branch for push mirrors
We should not synchronize the source repository with
the target root ref while updating a push mirror.
2018-09-21 14:29:59 -03:00
Douglas Barbosa Alexandre 8850fb9d67
Synchronize the default branch when updating a remote mirror 2018-09-10 16:12:49 -03:00
Stan Hu 578137f6e4 Fix remote mirrors failing if Git remotes have not been added
Remote mirrors only get created when the URL changes, However, during the GCP
migration, the remote mirror did not get created automatically. Plus, there's
no guarantee someone restoring a repository from backup would have this
remote. We now add the remote each time we attempt to fetch from the
repository.

This works because Gitaly doesn't throw up an exception or error if the
remote already exists:
https://gitlab.com/gitlab-org/gitaly/issues/1317

In the future, we should attempt to add if the remote doesn't exist:
https://gitlab.com/gitlab-org/gitaly/issues/1316

Closes #50562
2018-08-22 17:02:09 -07:00
Zeger-Jan van de Weg 8354ae3cef
Update remote happens through Gitaly only
This change makes closes another migration! And remotes tests around it,
mostly due to stubbing this was needed. Also, these are tested on the
Gitaly side too:
- https://gitlab.com/gitlab-org/gitaly/issues/791
-
6dd74543f6/internal/service/repository/fetch_remote_test.go

Closes https://gitlab.com/gitlab-org/gitaly/issues/789
2018-06-25 15:47:42 +02:00
Ahmad Sherif 019f5e2469 Add handling for commit/tags with big messages 2018-05-18 20:51:10 +02:00
Tiago Botelho 9a13059332 Backports every CE related change from ee-5484 to CE 2018-05-07 11:59:51 +02:00