oss-slu / oss-slu/PilotDataSynchronization

Failed TCP connection is silent and blocks all further connection attempts

Open
#179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug rust
Dominant language
Rust
Stars
4
Forks
8
Avg merge
5d 17h
Merged PRs (30d)
2

Description

Describe the bug
When TcpStream::connect fails, nothing appears in the GUI and every later attempt to connect also fails. The user has no way to know what happened or how to recover.

state.tcp_bichannel is set before the thread spawns (relay/src/state.rs:531) and tcp_thread_handle is set after it (relay/src/state.rs:633), both unconditionally, so tcp_connect returns Ok(()) even when the thread bailed. The guard at relay/src/state.rs:526-529 then rejects every retry with "TCP thread already exists", and that error goes to log_event, which is never displayed.

To Reproduce

  1. Start the relay with nothing listening on the target port.
  2. Enter an address and press Connect TCP.
  3. Status stays false and no error appears.
  4. Press Connect TCP again. Nothing happens, with no explanation.

Expected behavior
The failure is shown in the GUI, and pressing Connect TCP again retries instead of silently failing.

Additional context
Disconnect TCP is currently the only way to recover, because it is the only path that clears tcp_thread_handle (relay/src/state.rs:641-645). This is undiscoverable. The connection error is written to stderr only (relay/src/state.rs:540), which is invisible when the GUI is not launched from a terminal.

Found while writing the setup documentation in #138 / #178.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in relay/src/state.rs around tcp_connect at lines 526-545 and the thread-handle cleanup at lines 633-645. Reproduce the failure with no listener on the target port, then trace how the connection error reaches log_event and the GUI. Done means failed connections are visible to the user and a later Connect TCP attempt retries without requiring Disconnect TCP.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.