if port collision is detected use lsof to check what is running there#22300
if port collision is detected use lsof to check what is running there#22300
Conversation
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
Risk Rating: LOW (change is limited to error-path diagnostics, but it currently risks masking the original failure)
This PR adds extra diagnostics to the CRE CLI environment startup so that when a CI failure occurs due to a host port collision (“address already in use”), it attempts to run lsof to identify what process is using the conflicting port.
Changes:
- Add a helper (
describePortUsage) that runslsoffor a given TCP port and returns its output. - On setup failure containing “address already in use”, extract the port from the error string and print the
lsofresults.
Scrupulous human review suggested (high impact on debuggability of CI failures):
- The new “address already in use” error-handling path in
StartCLIEnvironment, specifically how failures fromlsofare handled (to avoid masking the original setup error) and how the port is parsed (to avoid panics / misleading errors). - The
lsofinvocation behavior (timeouts, availability on runners, and filtering to relevant socket state).
|





We want to discover what is causing these intermittent failures in CI: