Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Nov 7, 2024
1 parent 94952cd commit 6b56048
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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(),
)
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions engine/server/engine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const (
functionPathSeparator = "."
emptyFunctionName = ""
webappPortAddr = ":9711"
pprofPortAddr = ":6060"

remoteBackendConfigFilename = "remote_backend_config.json"
pathToStaticFolder = "/run/webapp"
Expand Down Expand Up @@ -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)
}
}()
Expand Down

0 comments on commit 6b56048

Please sign in to comment.