-
Notifications
You must be signed in to change notification settings - Fork 33
Rust bindings #40
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
base: main
Are you sure you want to change the base?
Rust bindings #40
Conversation
Pull Request Revisions
☑️ AI review skipped after 5 revisions, comment with `/review` to review again HelpReact with emojis to give feedback on AI-generated reviews:
We'd love to hear from you—reach out anytime at [email protected]. |
I may not have time to review immediately today, but in principle this will be great to have so I hope to get back to the PR ASAP. |
Awesome. Thank you. |
@raggi Poke 🙂 |
@raggi Hey, actually don't merge this. I'm leaking file descriptors using dial. Any hints you can give me about the internal implementation of file descriptors? I get an error setting non blocking on them so I'm guessing there's maybe something non-standard going on. Even when I close the file descriptors on the rust side, while looping and using dial, I'm still seeing a steady increase of open file descriptors in lsof for my process. I didn't see anything to explicitly close file descriptors in tailscale.h, but I think I may have seen one of the other libraries using tailscale_close(fd). I'm going to start digging through tailscale code but maybe you can give me a hint when you get a chance. Thanks. |
@raggi All good. I updated the code to use rust's OwnedFd and BorrowedFd instead of i32 for passing file descriptors. The leak ended up being something in the app I was importing the library with, so it wasn't 100% necessary, but it's cleaner. |
I'm rewriting my tailscale-based cluster from go to rust and would like to get this in if possible. It implements all of the major functions and contains the echo example. All of the tsnet crates on crates.io are outdated and broken.
Please take a look. Thank you thank you.