mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-12 12:14:19 +00:00
_init_active_project_language_backend launched the configured IDE with a fire-and-forget subprocess.Popen whenever no plugin server matched the activating project, independently in every session. Two or more sessions activating different projects at (nearly) the same time each decided independently that no server was running and raced jetbrains_launch_command against the same IDE config directory; only one IDE instance can hold that directory's lock, so the rest failed with a native DirectoryLock modal that never surfaces as a subprocess exit code, leaving Serena with no plugin server and no indication why. Add JetBrainsLaunchCoordinator.launch_and_wait_for_plugin_server, which serializes launches on a file lock keyed by jetbrains_launch_command and re-checks for a plugin server both before and after acquiring it, so a session that loses the race waits for the winner's IDE instead of starting its own. It also polls for the plugin server to become reachable after the launch command exits, closing the second gap the issue names: the launcher process exiting is not the same as the IDE being ready to serve. Fixes #1864