Skip to content

bug: Endpoint::close sometimes takes >4s even on local connections. #3875

@matheus23

Description

@matheus23

Describe the bug
When dogfooding, sometimes we'd exceed the 4s SHUTDOWN_TIME timeout in transfer.rs.
That's pretty unexpected. Even paths that are just newly created in quinn, not verified yet, should at maximum have a 3 * PTO draining period which would sum to 3s.

Relevant Logs
Lots of transfer logs that look like this:

Connected to 49975e383823c4ae09ae196fafa45b9e24f9e2f2d8b1312f5c2a2dfee2eb655c
Sent: "42cf758ff8 is saying hello!"
[49975e3838] Connection type changed to: Relay(RelayUrl("https://staging-euw1-1.relay.iroh.network./")) (RTT: 1.254430959s)
2026-01-19T15:16:14.347358Z ERROR transfer: Endpoint closing timed out
Error: Failed to shutdown endpoint in time

Expected behavior
The transfer logs should look like this:

Connected to 49975e383823c4ae09ae196fafa45b9e24f9e2f2d8b1312f5c2a2dfee2eb655c
Sent: "be12a8cde3 is saying hello!"
[49975e3838] Connection type changed to: Relay(RelayUrl("https://staging-euw1-1.relay.iroh.network./")) (RTT: 189.01663ms)
[49975e3838] Connection type changed to: Ip(176.199.209.244:26743) (RTT: 49.69848ms)
Received 10.00 MiB in 8.8536s (1.13 MiB/s, time to first byte 0.063306306s, 3681 chunks) (Shutdown took 0.0000s)
Path stats:
  Relay(RelayUrl("https://staging-euw1-1.relay.iroh.network./")): RTT 132.205998ms, tx=10385, rx=35209
  Ip(176.199.209.244:26743): RTT 96.374115ms, tx=96839, rx=10707656

Iroh

Version: This was the matheus23/dogfood-test branch, but its dependencies will soon be merged to main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    🏗 In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions