fix: set dind MTU in the GitLab-hosted CI template [LINBEE-27634] - #862
Conversation
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>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| OSS Licenses | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
There was a problem hiding this comment.
✨ 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
There was a problem hiding this comment.
🟢 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=1360to thedocker:dindservice 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
left a comment
There was a problem hiding this comment.
LGTM // approved in Slack with WorkerB
✨ PR Description
Purpose: Configure the Maximum Transmission Unit (MTU) for Docker-in-Docker services in the GitLab CI template.
Main changes:
--mtu=1360command argument to thedocker:dindservice 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