Skip to content

fix(gitlab): Fail fast on connect for project webhook calls - #128491

Open
sentry-junior[bot] wants to merge 1 commit into
masterfrom
fix/gitlab-webhook-connect-timeout
Open

sentry-junior[bot] wants to merge 1 commit into
masterfrom
fix/gitlab-webhook-connect-timeout

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Since #127268, restore_repos_batch calls on_create_repository for every repository it reactivates. The task handles up to 100 repositories and has a 120s deadline. When the self-hosted GitLab instance can't be reached, each project hook call waits out the full 10s IntegrationProxyClient connect timeout. That adds up past the deadline, so the task is killed while it's still connecting (ProcessingDeadlineExceeded in restore_repos_batch, with the stack ending in create_project_webhook → sock.connect).

The project hook create, update and delete calls now use a 3s connect timeout. The read timeout stays at the 10s client default. These calls go to a host that is either reachable or not, so a long connect wait doesn't help.

This cuts the cost per repository from about 10s to about 3s, but it doesn't fully remove the risk. A batch with enough repositories on a dead host can still go over 120s, because the loop keeps trying each repository. If that turns out to matter, a follow-up can stop reconciling webhooks for the rest of a batch after the first host-unreachable error.

via Gio.

--

View Junior Session [Sentry]

Repo sync restores and reconciles webhooks for up to 100 repositories in
one restore_repos_batch task with a 120s deadline. Against an unreachable
self-hosted GitLab, each hook call waited the full 10s proxy client
connect timeout, so a batch could exceed the deadline. Use a 3s connect
timeout for the project hook create, update, and delete calls.

Co-Authored-By: Giovanni Guidini <giovanni.guidini@sentry.io>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 22, 2026 07:15
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants