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

Connection problems when connecting by node id and region id #1822

Closed
rklaehn opened this issue Nov 20, 2023 · 2 comments
Closed

Connection problems when connecting by node id and region id #1822

rklaehn opened this issue Nov 20, 2023 · 2 comments
Labels
bug Something isn't working c-iroh

Comments

@rklaehn
Copy link
Contributor

rklaehn commented Nov 20, 2023

I have a very small request/response iroh service in https://github.com/n0-computer/iroh-examples/, specifically https://github.com/n0-computer/iroh-examples/tree/main/content-tracker .

It is a content tracker, but that is besides the issue. Basically you do a connection via node id and region id, then send a very small message, and get back a very small response.

I found that this does not work reliably without the inclusion of the ip addresses. The connection establishment and sending initial data works, but the response never gets through and the connection eventually times out on the sender side.

Sender:

❯ cargo run query --tracker jfnwg2wbgbgignugsmcl7vd2ywxkvjjkbw4sw7xdfv3mnpcsorgq bafkr4ih7kfrg3q323ujxli24ms4koorxchupucvbauuvfz7mlgzbixd2li
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
     Running `target/debug/iroh-content-tracker query --tracker jfnwg2wbgbgignugsmcl7vd2ywxkvjjkbw4sw7xdfv3mnpcsorgq bafkr4ih7kfrg3q323ujxli24ms4koorxchupucvbauuvfz7mlgzbixd2li`
trying to connect to tracker at PublicKey(jfnwg2wbgbgignug)
connected to [fd15:70a:510b::]:12345
opened bi stream
sending query

Error: read error: connection lost

Caused by:
    0: connection lost
    1: timed out

Receiver:

calling accept_bi
got bi stream
handle query: Query { content: HashAndFormat { hash: Hash(ff51626dc37add1375a35c64b8a73a3711e8fa0aa1052952e7ec59b2145c7a5a), format: Raw }, flags: QueryFlags { complete: true, verified: false } }
...

So the msg immediately gets to the receiver, but the response and/or the closing of the stream never arrives.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in iroh Nov 20, 2023
@rklaehn rklaehn added bug Something isn't working c-iroh labels Nov 20, 2023
@rklaehn
Copy link
Contributor Author

rklaehn commented Nov 20, 2023

Disregard. It was just me being stupid with a lock. Turns out you should drop your lock before sleep.

@rklaehn
Copy link
Contributor Author

rklaehn commented Nov 21, 2023

Yep, this was just a stupid lock.

@rklaehn rklaehn closed this as completed Nov 21, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in iroh Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c-iroh
Projects
Archived in project
Development

No branches or pull requests

1 participant