-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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(ext/node): node compatibility issue missing fd in createServer callback socket object #27789
Conversation
0f61f5f
to
ffde45b
Compare
please take a look at this PR: denoland/deno#27789 Use an internal symbol to expose fd created after establishing a socket connection in the server side. The node apis expose fd, this ensures the deno node apis are compatible.
…ol in deno_core Please take a look at PR: denoland/deno#27789 This change will help to expose fd to server when a socket connection is established.
@muthu90tech I merged your |
Thanks @bartlomieju , Once the deno_core version with the fix is released, should I update the current PR to point to the deno_core version with the fix, or will that be handled ? Thank you |
0c04900
to
714897c
Compare
@bartlomieju , I noticed main branch has deno_core 0.336.0, which has the new symbol, so I rebased. Thanks |
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.
The api to get the fd in tokio library is not implemented on windows, I notice build issues around it. Is there a way to exclude implementation just for windows, like a MACRO ? thank you
You can use Lines 643 to 646 in 17a51c4
|
…lback socket object This PR will address the node compatibility issue where, the callback socket object in net.createServer is missing a fd in socket._handle fixes: denoland#27788
f375a2a
to
8e66d6d
Compare
7e084f0
to
42d1cdc
Compare
Signed-off-by: Muthuraj Ramalingakumar <[email protected]>
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.
@kt3k , I addressed the lint issues, but when running the integration tests locally even without my changes I see 60 failures, I noticed the integration failed in CI too, are there flaky issues with test bed? Thank you
Nvm, I think tests in CI are passing now. |
@@ -180,14 +182,27 @@ pub async fn op_net_accept_tcp( | |||
.try_or_cancel(cancel) | |||
.await | |||
.map_err(accept_err)?; | |||
let mut _fd_raw: Option<Fd> = None; |
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.
nit: probably this shouldn't be prefixed with _
as the value is used later.
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.
@kt3k , yes I initially had fd_raw
, but the lint on linux complained about
error: value assigned to `fd_raw` is never read
--> ext/net/ops.rs:185:11
|
185 | let mut fd_raw: Option<Fd> = None;
| ^^^^^^
|
= help: maybe it is overwritten before being read?
= note: `-D unused-assignments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_assignments)]`
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.
Ok. Makes sense
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 with nits
@bartlomieju Can you take another look?
Thanks for your contribution! |
…llback socket object (#27789)
This PR will address the node compatibility issue where, the callback socket object in net.createServer is missing a fd in socket._handle
Modified this PR to use internal symbol to expose fd instead of exposing it via lib.deno.d.ts
denoland/deno_core#1061
fixes: #27788