Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default timeout for ipni CLI doesn’t seem to be honoured #105

Closed
masih opened this issue May 14, 2024 · 4 comments
Closed

The default timeout for ipni CLI doesn’t seem to be honoured #105

masih opened this issue May 14, 2024 · 4 comments
Assignees

Comments

@masih
Copy link
Member

masih commented May 14, 2024

Reported when syncing very long ad chains:

The default timeout for ipni CLI doesn’t seem to be honoured. The command shows the timeout to be 10s but it wait for well over 1 minute before timing out. If I explicitly set the timeout to be 10s, then it seems to work.

Specific example:

  • CID baguqeerawlmmxljdh2xl72eky7xkqntrdkjul5ayzhvklhgfnyckdzyiavcq
  • Provider ID 12D3KooWCxU3TgQdcfkLegGr1YxvJn2x3Y3xfiUyTCA7V2rM6hAo
@gammazero gammazero self-assigned this May 15, 2024
@gammazero
Copy link
Contributor

The publisher address associated with that Provider ID, /ip4/202.181.153.253/tcp/3104/http/, is no longer reachable.

@gammazero
Copy link
Contributor

gammazero commented May 16, 2024

Testing shows that the default timeout is correctly communicated to the ipni client and to go-libipni. The timeout is correctly set in the HTTP client used with libp2phttp for HTTP over libp2p.

The timeout does not appear to be propagated to libp2p reading data. This issue describes the problem: libp2p/go-libp2p#2533
Fixing this by adhering to the request context should fix the timeout handling.

There are other situations where the timeout is working but may not appear to work:

  • When syncing an advertisement chain, each ad is fetched with a separate request. This means each fetch has its own timeout. If 10 ads take 5s each to fetch and fetching the 6th ad times out after 10s, it will appear to take 60s to timeout.
  • Each multihash block is fetched with a separate request. If it takes 9s to request each of the first 3 blocks, and the 4th block fails due to timeout, it will appear to take 37s (9s+9s+9s+10s) to timeout, even though the timeout is 10s.
  • A libp2p stream reset error is automatically retried once. The retry is a new request with a new timeout.

@masih
Copy link
Member Author

masih commented May 16, 2024

CC @LexLuthr

@gammazero
Copy link
Contributor

Fixed by libp2p/go-libp2p#2796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants