Skip to content

fix: set dind MTU in the GitLab-hosted CI template [LINBEE-27634] - #862

Merged
MishaKav merged 1 commit into
mainfrom
LINBEE-27634-gitlab-hosted-dind-mtu
Jul 30, 2026
Merged

fix: set dind MTU in the GitLab-hosted CI template [LINBEE-27634]#862
MishaKav merged 1 commit into
mainfrom
LINBEE-27634-gitlab-hosted-dind-mtu

Conversation

@MishaKav

@MishaKav MishaKav commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

✨ PR Description

Purpose: Configure the Maximum Transmission Unit (MTU) for Docker-in-Docker services in the GitLab CI template.

Main changes:

  • Added --mtu=1360 command argument to the docker:dind service configuration.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

GitLab-hosted runners attach the dind container's network at MTU 1360, but the
Docker daemon inside dind defaults its bridge to 1500. Oversized packets are
then dropped silently, so requests from the rules engine connect at TCP and hang
in the TLS handshake until the client times out - jobs sat for 15-30 minutes and
produced no review.

Measured on a GitLab-hosted runner, identical containers and endpoint:
  MTU 1500 -> 4/4 requests stalled 40s
  MTU 1360 -> 0/4 stalled, 261ms each
End to end, one job went from 17.5 minutes to 83 seconds.

The Kubernetes template already sets --mtu (1450, correct for a VXLAN overlay)
and is left alone; the shell template is untouched since self-managed hosts are
usually 1500 and lowering it there would only cost throughput.

Ref: https://support.gitlab.com/hc/en-us/articles/27528955698972

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@orca-security-us orca-security-us Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed OSS Licenses high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@linearb linearb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ PR Review

The PR adds an MTU fix for Docker-in-Docker on GitLab-hosted CI runners by hardcoding --mtu=1360 in the dind service command. The change is minimal and targeted, but the hardcoded value in a shared/downloaded template warrants attention.

1 issues detected:

🧹 Maintainability - The hardcoded MTU value of 1360 is tied to GitLab.com's network topology and is embedded in a general-purpose downloadable template without any explanatory context, making it silently incorrect for other environments. 🛠️

Details: The MTU value 1360 is hardcoded directly in a template that users download and apply to their own projects. This value is specific to GitLab.com shared runners and may not be appropriate for self-managed GitLab instances or other infrastructure where the underlying network MTU differs. Users who copy this template for non-GitLab.com environments may unknowingly apply a suboptimal or incorrect MTU.

File: docs/downloads/gitlab-ci.yml (14-14)

🛠️ A suggested code correction is included in the review comments.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

Comment thread docs/downloads/gitlab-ci.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready to approve

The change is minimal, syntactically valid for GitLab CI service configuration, and aligns with the stated purpose without introducing additional risk.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Configures Docker-in-Docker networking in the GitLab CI downloadable template by setting an explicit Docker daemon MTU, which can help avoid connectivity issues in environments with reduced MTU (e.g., certain hosted runners/VPN overlays).

Changes:

  • Add --mtu=1360 to the docker:dind service command in the GitLab CI template.
File summaries
File Description
docs/downloads/gitlab-ci.yml Adds an MTU flag to the docker:dind service to improve CI networking reliability in constrained MTU environments.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Low

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@nivSwisa1 nivSwisa1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM // approved in Slack with WorkerB

@MishaKav
MishaKav merged commit 1f355ea into main Jul 30, 2026
11 checks passed
@MishaKav
MishaKav deleted the LINBEE-27634-gitlab-hosted-dind-mtu branch July 30, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants