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

fix: routing findprovs hangs with no records #10206

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

aschmahmann
Copy link
Contributor

@aschmahmann aschmahmann commented Nov 8, 2023

The IPNS name resolution fix in kubo v0.22.0 (coming from go-libp2p-routing-helpers libp2p/go-libp2p-routing-helpers#75) resulted in changing the semantics of Routing.FindProvidersAsync such that it no longer returns a channel before the first result comes back.

This is bad, functions that return with channels should generally do so quickly. Here it is particularly bad because the event channel used in DHT queries ends up getting clogged (if there are no providers for the CID) which leads to a deadlock until the context is cancelled.

While this should be fixed in go-libp2p-routing-helpers, this should help for now and seems safe.

@aschmahmann aschmahmann requested a review from a team as a code owner November 8, 2023 06:18
@aschmahmann
Copy link
Contributor Author

@Jorropo @hacdias thoughts, does this deserve a specific changelog entry (rather than an auto-generated one)? routing/dht findprovs is a plumbing command, but it's also one that a number of people are familiar with. Doesn't seem like a callout to me.

Seems like this should get cherry-picked for the release too if we're happy with it.

@hacdias hacdias added the skip/changelog This change does NOT require a changelog entry label Nov 8, 2023
Copy link
Member

@hacdias hacdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I don't think it needs a changelog entry.

@hacdias hacdias merged commit 846310e into master Nov 8, 2023
23 of 25 checks passed
@hacdias hacdias deleted the fix/routing-findprovs-empty-hang branch November 8, 2023 09:03
@Jorropo
Copy link
Contributor

Jorropo commented Nov 8, 2023

I belive we should fix it so that the semantics are how they used to be.

@hacdias
Copy link
Member

hacdias commented Nov 8, 2023

@Jorropo I do agree (and I think @aschmahmann too as per his comment above), but I think it's a good temporary fix while the rest isn't fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip/changelog This change does NOT require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants