Skip to content

Add dynamic port allocation for Flask server to avoid port conflicts#1

Open
Yin-SHT wants to merge 1 commit into
MATCHA-MIT:mainfrom
Yin-SHT:fix-port-conflicts
Open

Add dynamic port allocation for Flask server to avoid port conflicts#1
Yin-SHT wants to merge 1 commit into
MATCHA-MIT:mainfrom
Yin-SHT:fix-port-conflicts

Conversation

@Yin-SHT

@Yin-SHT Yin-SHT commented Aug 31, 2025

Copy link
Copy Markdown

Summary
Adds automatic port detection and switching functionality to prevent port conflicts when running the trace collection script.

Problem
The script hardcodes port 1234 for the Flask server. If the script terminates abnormally (crash, force kill, etc.), the port may remain occupied, causing subsequent runs to fail.

Solution
Implemented automatic port detection and fallback mechanism:

  1. Check if default port (1234) is available before binding
  2. Automatically try alternative ports if default is occupied
  3. Display which port is being used for better debugging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant