Skip to content

Commit

Permalink
fix: avoid system port numbers for internal s3 port
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Mitchell <[email protected]>
  • Loading branch information
starpit committed Sep 26, 2024
1 parent 0ea17f3 commit 1a3cc57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/fe/prepare-run.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ func PrepareForRun(runname string, popts PrepareOptions, opts build.Options) (ll
}

// Assign a port for the internal S3 (TODO: we only need to do
// this if this run will be using an internal S3)
internalS3Port := rand.Intn(65536) + 1
// this if this run will be using an internal S3). We use the
// range of "ephemeral"
// ports. https://en.wikipedia.org/wiki/Ephemeral_bbport
portMin := 49152
portMax := 65535
internalS3Port := rand.Intn(portMax-portMin+1) + portMin
if verbose {
fmt.Fprintf(os.Stderr, "Using internal S3 port %d\n", internalS3Port)
}
Expand Down

0 comments on commit 1a3cc57

Please sign in to comment.