Skip to content

Commit 761e678

Browse files
committed
fix: ignore EINVAL when fsyncing /dev/stdout
Fixes: #5532
1 parent 52d7dfa commit 761e678

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

cli/scaletest.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strconv"
1010
"strings"
1111
"sync"
12+
"syscall"
1213
"time"
1314

1415
"github.com/google/uuid"
@@ -185,7 +186,9 @@ func (o *scaleTestOutput) write(res harness.Results, stdout io.Writer) error {
185186
// Sync the file to disk if it's a file.
186187
if s, ok := w.(interface{ Sync() error }); ok {
187188
err := s.Sync()
188-
if err != nil {
189+
// On Linux, EINVAL is returned when calling fsync on /dev/stdout. We
190+
// can safely ignore this error.
191+
if err != nil && !xerrors.Is(err, syscall.EINVAL) {
189192
return xerrors.Errorf("flush output file: %w", err)
190193
}
191194
}

examples/templates/kubernetes/main.tf

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ variable "namespace" {
3131
description = "The namespace to create workspaces in (must exist prior to creating workspaces)"
3232
}
3333

34-
variable "home_disk_size" {
35-
type = number
36-
description = "How large would you like your home volume to be (in GB)?"
37-
default = 10
38-
validation {
39-
condition = var.home_disk_size >= 1
40-
error_message = "Value must be greater than or equal to 1."
41-
}
42-
}
43-
4434
provider "kubernetes" {
4535
# Authenticate via ~/.kube/config or a Coder-specific ServiceAccount, depending on admin preferences
4636
config_path = var.use_kubeconfig == true ? "~/.kube/config" : null
@@ -85,22 +75,6 @@ resource "coder_app" "code-server" {
8575
}
8676
}
8777

88-
resource "kubernetes_persistent_volume_claim" "home" {
89-
metadata {
90-
name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}-home"
91-
namespace = var.namespace
92-
}
93-
wait_until_bound = false
94-
spec {
95-
access_modes = ["ReadWriteOnce"]
96-
resources {
97-
requests = {
98-
storage = "${var.home_disk_size}Gi"
99-
}
100-
}
101-
}
102-
}
103-
10478
resource "kubernetes_pod" "main" {
10579
count = data.coder_workspace.me.start_count
10680
metadata {
@@ -123,19 +97,6 @@ resource "kubernetes_pod" "main" {
12397
name = "CODER_AGENT_TOKEN"
12498
value = coder_agent.main.token
12599
}
126-
volume_mount {
127-
mount_path = "/home/coder"
128-
name = "home"
129-
read_only = false
130-
}
131-
}
132-
133-
volume {
134-
name = "home"
135-
persistent_volume_claim {
136-
claim_name = kubernetes_persistent_volume_claim.home.metadata.0.name
137-
read_only = false
138-
}
139100
}
140101
}
141102
}

0 commit comments

Comments
 (0)