From 6b56048d8e7a09d5f1512f2f8a6c39af5e809c02 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Thu, 7 Nov 2024 10:54:07 -0800 Subject: [PATCH] lint --- .../engine_functions/create_engine.go | 9 +++++---- engine/server/engine/main.go | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go index 0cc596c907..20f7ce4738 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go @@ -31,6 +31,7 @@ const ( enclaveManagerUIPort = 9711 enclaveManagerAPIPort = 8081 engineDebugServerPort = 50102 // in ClI this is 50101 and 50103 for the APIC + pprofServerPort = 6060 maxWaitForEngineAvailabilityRetries = 40 timeBetweenWaitForEngineAvailabilityRetries = 2 * time.Second logsStorageDirPath = "/var/log/kurtosis/" @@ -169,12 +170,12 @@ func CreateEngine( ) } - pprofPortSpec, err := port_spec.NewPortSpec(6060, consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL) + pprofPortSpec, err := port_spec.NewPortSpec(pprofServerPort, consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL) if err != nil { return nil, stacktrace.Propagate( err, - "An error occurred creating the pprofs http port spec object using number '%v' and protocol '%v'", - 6060, + "An error occurred creating the pprof http port spec object using number '%v' and protocol '%v'", + pprofServerPort, consts.EngineTransportProtocol.String(), ) } @@ -225,7 +226,7 @@ func CreateEngine( enclaveManagerUIDockerPort: docker_manager.NewManualPublishingSpec(uint16(enclaveManagerUIPort)), enclaveManagerAPIDockerPort: docker_manager.NewManualPublishingSpec(uint16(enclaveManagerAPIPort)), restAPIDockerPort: docker_manager.NewManualPublishingSpec(engine.RESTAPIPortAddr), - pprofDockerPort: docker_manager.NewManualPublishingSpec(6060), + pprofDockerPort: docker_manager.NewManualPublishingSpec(pprofServerPort), } // Configure the debug port only if it's required diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 69b21c42f5..5debe0bd20 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -73,6 +73,7 @@ const ( functionPathSeparator = "." emptyFunctionName = "" webappPortAddr = ":9711" + pprofPortAddr = ":6060" remoteBackendConfigFilename = "remote_backend_config.json" pathToStaticFolder = "/run/webapp" @@ -200,10 +201,9 @@ func runMain() error { return stacktrace.Propagate(err, "Failed to create an enclave manager for backend type '%v' and config '%+v'", serverArgs.KurtosisBackendType, backendConfig) } - // start server go func() { logrus.Info("Starting pprof server on :6060") - if err := http.ListenAndServe("0.0.0.0:6060", nil); err != nil { + if err := http.ListenAndServe(pprofPortAddr, nil); err != nil { logrus.Fatalf("pprof server failed: %v", err) } }()