cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature Request] Fix free-port assignment to actually try to connect

Open cretz opened this issue 1 year ago • 0 comments

Describe the solution you'd like

We assumed incorrectly that OSs won't give out recently bound ports, but tests reveal it may. Fix https://github.com/temporalio/cli/blob/main/temporalcli/devserver/freeport.go to:

  • Just have one GetFreePort() (int, error) call and none of that extra port-provider stuff
  • Make the GetFreePort() listener also accept a socket connection before closing both the listener and socket and returning the port

Probably don't even need a separate file anymore, this can be a simple single-method utility with the rest of the dev server stuff

cretz avatar May 06 '24 13:05 cretz