-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add windows Ipc Client implementation #7187
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
Conversation
|
@mattsse PTAL when you available and let me know if I'm heading in the right direction. Thanks! |
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, one suggestion re structure
crates/rpc/ipc/src/client.rs
Outdated
| pub struct Receiver { | ||
| inner: FramedRead<tokio::net::unix::OwnedReadHalf, StreamCodec>, | ||
| #[cfg(unix)] | ||
| inner: FramedRead<OwnedReadHalf, StreamCodec>, | ||
| #[cfg(windows)] | ||
| inner: FramedRead<Arc<NamedPipeClient>, StreamCodec>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great,
what I would like to do instead is:
convert client into a module with
unix.rs
win.rs
and duplicate the types then client/mod.rs reexports based on windows or UNIX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
onbjerg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for taking this on 👑
|
@mattsse @onbjerg > cross test --target x86_64-pc-windows-gnu -p reth-ipc error[E0432]: unresolved import `winapi::shared::winerror`
--> /Users/abnerzheng/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parity-tokio-ipc-0.9.0/src/win.rs:1:21
|
1 | use winapi::shared::winerror::{ERROR_PIPE_BUSY, ERROR_SUCCESS};
| ^^^^^^^^ could not find `winerror` in `shared`Looks like The server side implementation relay on |
|
I think we only use this for the |
|
yeah this is indeed unmaintained and we should actually switch Is the cross build issue a problem? |
I think if we try to build ipc crate in windows machine, then it will issue the error.
Yes, but then we have to guard the 'server' mod with #[cfg(unix)] as well, because it won't compile in windows system. |
|
I think we should transition to: |
No problem, I will continue the transition in tomorrow. |
|
Hey @AbnerZheng! Are you blocked on anything here? Let me know 😊 |
Would take it another try this weekend and will ping you if there are any problem. |
|
@onbjerg I have switched to use interprocess v1.2.1, which would unblock this PR. |
deny.toml
Outdated
| # See https://spdx.org/licenses/ for list of possible licenses | ||
| # [possible values: any SPDX 3.7 short identifier (+ optional exception)]. | ||
| allow = [ | ||
| "CC0-1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add it under exceptions like the other CC0-1.0 deps we have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| on_ready.send(Ok(())).ok(); | ||
|
|
||
| let mut incoming = Monitored::new(incoming, &stop_handle); | ||
| let mut connections = FuturesUnordered::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsonrpsee has switch to use FuturesUnordered in PR paritytech/jsonrpsee#1062, which address some issues when upgrading tokio. The PR also removed the need of Incoming, Monitored, which unblock this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prelim look this looks fine to me, ptal @mattsse
please move the license exception into where we have our other CC0 deps
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, ty
but futuresunordered has to go
| // FuturesUnordered won't poll anything until this line but because the | ||
| // tasks are spawned (so that they can progress independently) | ||
| // then this just makes sure that all tasks are completed before | ||
| // returning from this function. | ||
| while connections.next().await.is_some() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unreachable and results in unbounded mem
please check jsonrpsee server loop on main
https://github.com/paritytech/jsonrpsee/blob/master/server/src/server.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but would like merge it first, and fire a new PR later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sg, could you please open an issue for this then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#7916
would fire a PR today.
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm,
needs followup re fut unordered
Close #2786.