Relay shows Baton Connected after the plugin has gone, and never accepts it again

Abierto
#255 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
networking

Línea de trabajo

Start with the receive loop in relay/src/state.rs around line 745 and read the Windows behavior described in #254. Decide how the relay can detect a disconnected plugin when Ok(0) is ambiguous, considering the heartbeat or blocking-reader options in the issue. Done means the relay shows :( No Baton Connection after disconnection and accepts a reconnect without manual IPC controls.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:relay bug needs-triage rust

Describe the bug

Once the relay has accepted the plugin, it never notices the plugin going away. The window keeps showing :) Baton Connected!, and a plugin that reconnects is never served, so the only recovery is Disconnect IPC then Connect IPC, or restarting the relay.

The receive loop in ipc_connect treats Ok(0) as "no data yet" and keeps polling (relay/src/state.rs:745). On Windows, interprocess returns Ok(0) both for an empty pipe and for one whose other end has closed (see #254), so the loop cannot tell the two apart and never exits. The BrokenPipe arm below it is unreachable on Windows for the same reason. accept() is only called again after that loop exits, so nothing new is accepted.

In the lab this followed directly from #254: the plugin dropped the connection after its failed handshake, but the relay still showed Baton Connected, which made the problem look like it was further down the line.

To Reproduce

  1. On Windows, start the relay, then X-Plane, so the plugin connects.
  2. Untick PilotDataSync in Plugin Admin, or quit X-Plane.
  3. The relay still shows :) Baton Connected!.
  4. Re-tick the plugin. Nothing reaches the relay until Disconnect IPC / Connect IPC is pressed.

Expected behavior

The relay notices the plugin has gone, shows :( No Baton Connection, and goes back to accepting, so the plugin can reconnect without anyone touching the relay.

Additional context

Because a read cannot distinguish "empty" from "closed" on Windows, this needs a signal other than the read result. Options include a heartbeat line from baton with a timeout on the relay side, or a blocking reader thread, where Ok(0) really does mean closed. baton already writes SHUTDOWN on a clean stop, but that does not cover X-Plane crashing or the handshake failing.

Lenguaje dominante
Python
Estrellas
4
Forks
9
Merge medio
3 d 21 h
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de oss-slu/PilotDataSynchronization

Todos los issues de oss-slu/PilotDataSynchronization

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.