From 4152e4422fda25508ed2ad28c2a8946b1a1693d6 Mon Sep 17 00:00:00 2001 From: Julian Sommer <115516918+juliansommer@users.noreply.github.com> Date: Wed, 18 Mar 2026 10:14:52 +1000 Subject: [PATCH] chore: remove redundant x/net/http2 and automaxprocs deps ForceAttemptHTTP2 + NextProtos ALPN already handle HTTP/2 on Go 1.22+. Go 1.25+ runtime is container-aware for GOMAXPROCS by default. --- go.mod | 4 ++-- hive/objectstore/objectstore.go | 6 ------ hive/services/nats/nats.go | 9 --------- hive/utils/utils.go | 6 ------ 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 6c5285d45..984620ba0 100644 --- a/go.mod +++ b/go.mod @@ -18,8 +18,6 @@ require ( github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 - go.uber.org/automaxprocs v1.6.0 - golang.org/x/net v0.51.0 gopkg.in/ini.v1 v1.67.1 ) @@ -114,11 +112,13 @@ require ( go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/metric v1.41.0 // indirect go.opentelemetry.io/otel/trace v1.41.0 // indirect + go.uber.org/automaxprocs v1.6.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.48.0 // indirect golang.org/x/exp/typeparams v0.0.0-20260218203240-3dfff04db8fa // indirect golang.org/x/mod v0.33.0 // indirect + golang.org/x/net v0.51.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/telemetry v0.0.0-20260304144227-18da59047661 // indirect diff --git a/hive/objectstore/objectstore.go b/hive/objectstore/objectstore.go index eb5037240..0c0fa467b 100644 --- a/hive/objectstore/objectstore.go +++ b/hive/objectstore/objectstore.go @@ -8,7 +8,6 @@ import ( "crypto/tls" "errors" "io" - "log/slog" "net/http" "strings" "sync" @@ -18,7 +17,6 @@ import ( "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" - "golang.org/x/net/http2" ) // NoSuchKeyError represents a missing object error, compatible with AWS S3 errors @@ -67,10 +65,6 @@ func NewS3ObjectStoreFromConfig(host, region, accessKey, secretKey string) *S3Ob ForceAttemptHTTP2: true, } - if err := http2.ConfigureTransport(tr); err != nil { - slog.Warn("Failed to configure HTTP/2", "error", err) - } - httpClient := &http.Client{Transport: tr} sess := session.Must(session.NewSession(&aws.Config{ diff --git a/hive/services/nats/nats.go b/hive/services/nats/nats.go index bd5bf641f..333a37afa 100644 --- a/hive/services/nats/nats.go +++ b/hive/services/nats/nats.go @@ -7,7 +7,6 @@ import ( "github.com/mulgadc/hive/hive/utils" "github.com/nats-io/nats-server/v2/server" - "go.uber.org/automaxprocs/maxprocs" ) var serviceName = "nats" @@ -118,14 +117,6 @@ func launchService(config *Config) (err error) { server.PrintAndDie(err.Error()) } - // Adjust MAXPROCS if running under linux/cgroups quotas. - undo, err := maxprocs.Set(maxprocs.Logger(ns.Debugf)) - if err != nil { - slog.Warn("Failed to set GOMAXPROCS", "err", err) - } else { - defer undo() - } - ns.WaitForShutdown() return nil diff --git a/hive/utils/utils.go b/hive/utils/utils.go index 642a68e47..c21d1ba07 100644 --- a/hive/utils/utils.go +++ b/hive/utils/utils.go @@ -27,7 +27,6 @@ import ( "github.com/mulgadc/hive/hive/awserrors" "github.com/mulgadc/hive/hive/config" "github.com/pterm/pterm" - "golang.org/x/net/http2" ) // GenerateResourceID generates a unique resource ID with the given prefix. @@ -214,11 +213,6 @@ func CreateS3Client(cfg *config.Config) *s3.S3 { ForceAttemptHTTP2: true, } - // CRITICAL: Configure HTTP/2 support with custom TLS config - if err := http2.ConfigureTransport(tr); err != nil { - slog.Warn("Failed to configure HTTP/2", "error", err) - } - httpClient := &http.Client{Transport: tr} sess := session.Must(session.NewSession(&aws.Config{