Skip to content

Bug: Sender and receiver can hang forever (no read deadline, no overall timeout) #21

Open

Description

@LinuxSuRen

Description

Several failure paths never terminate, on both ends:

  • pkg/sender.go:167 waitingMissing reads with no deadline — the SetReadDeadline call is commented out. If all done packets are lost (plain UDP loss), or the receiver dies, the sender blocks in conn.Read forever.
  • the sender's resend goroutine prints . every 3 s indefinitely (pkg/sender.go:100) with no bound,
  • the receiver re-sends miss for every missing index every second in a for buffer.Size() > 0 loop with no cap and no timeout (pkg/waiter.go:151) — if the sender died, it spins forever; WriteTo errors are ignored,
  • requestDone (pkg/waiter.go:160) retries in an empty-bodied for err := ...; err != nil; {} loop without bound.

Net effect: a single lost done or a crashed peer leaves both processes running forever with no way to finish or fail.

Suggested fix

  • restore the read deadline in waitingMissing and add an idle timeout on both ends,
  • add an overall transfer deadline / retry budget after which the CLI reports failure and exits non-zero,
  • propagate context cancellation so Ctrl-C is clean.

Environment: master@a4ebe30.

Activity

  1. added
    bug
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions