refactor(framework): Delay launch SuperExec in isolation subprocess#6963
refactor(framework): Delay launch SuperExec in isolation subprocess#6963
SuperExec in isolation subprocess#6963Conversation
There was a problem hiding this comment.
Pull request overview
This PR delays launching the flower-superexec subprocess when running SuperLink in isolation subprocess mode, aiming to avoid a startup race where SuperExec starts before SuperLink is fully ready.
Changes:
- Add a 1-second delay before starting SuperExec when
--isolation=subprocessis used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| command = ["flower-superexec", "--insecure"] | ||
| command += ["--appio-api-address", appio_address] | ||
| command += ["--plugin-type", ExecPluginType.SERVER_APP] | ||
| command += ["--parent-pid", str(os.getpid())] | ||
| sleep(1) # Delay launch of SuperExec to ensure SuperLink is ready | ||
| # pylint: disable-next=consider-using-with | ||
| subprocess.Popen(command) |
There was a problem hiding this comment.
Using a fixed sleep(1) to avoid a startup race is brittle and can still fail on slower machines/CI (or unnecessarily slow down startup on fast machines). Prefer a deterministic readiness check before launching SuperExec (e.g., poll until the ServerAppIo address accepts a TCP connection / gRPC channel is ready with a bounded timeout, or move retry/backoff logic into SuperExec when connecting).
No description provided.