iawia002 opened PR #8671 from iawia002:fix-invalid-socket-address
to bytecodealliance:main
:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->#8563 removes the port from the authority, it makes the target address cannot be correctly resolved when opening a TCP connection. This results in that if we want to send an HTTP request in the wasi component, an error
ErrorCode::ConnectionRefused
will be reported directly. The underlying error isinvalid socket address
:<img width="521" alt="Screenshot 2024-05-21 at 17 21 56" src="https://github.com/bytecodealliance/wasmtime/assets/9134003/6473efef-4306-45c7-8ca4-e5101d14f071">
/cc @alexcrichton @elliottt
iawia002 requested alexcrichton for a review on PR #8671.
iawia002 requested wasmtime-core-reviewers for a review on PR #8671.
What if the program explicitly specified a port different from 80 or 443? Wouldn't this change break that by creating a nonsensical address like
127.0.0.1:1234:80
when trying to requesthttp://127.0.0.1:1234/some_page
?
iawia002 commented on PR #8671:
What if the program explicitly specified a port different from 80 or 443? Wouldn't this change break that by creating a nonsensical address like
127.0.0.1:1234:80
when trying to requesthttp://127.0.0.1:1234/some_page
?Indeed, I didn't consider that. I will update it again.
iawia002 updated PR #8671.
alexcrichton commented on PR #8671:
Does this mean that
default_send_request_handler
basically doesn't work by default? If so, that seems bad!Would you be up for adding a test for this?
alexcrichton edited a comment on PR #8671:
Does this mean that
default_send_request_handler
basically previously didn't work by default? If so, that seems bad!Would you be up for adding a test for this?
morenol commented on PR #8671:
Does this mean that
default_send_request_handler
basically previously didn't work by default? If so, that seems bad!Would you be up for adding a test for this?
I think that that is the case, can we have a fix like this one on a 21.0.1 version?
morenol edited a comment on PR #8671:
Does this mean that
default_send_request_handler
basically previously didn't work by default? If so, that seems bad!Would you be up for adding a test for this?
I think that that is the case, could we have a fix like this one on a 21.0.1 version?
alexcrichton commented on PR #8671:
Yeah, definitely seems bad enough for a point release! Would you be up for adding a test here? perhaps fetching something like
example.com
or similar? That'll be flaky over time but we can try to add various exceptions for possible errors due to flakiness over time.
iawia002 updated PR #8671.
iawia002 updated PR #8671.
iawia002 commented on PR #8671:
I have added a test for this case, following @elliottt's advice in https://github.com/bytecodealliance/wasmtime/pull/8676#discussion_r1609131895, PTAL @alexcrichton @elliottt
alexcrichton submitted PR review:
Thanks!
elliottt commented on PR #8671:
Could you remove the use of ssl in your test program? CI failed because it's not supported on riscv64.
alexcrichton updated PR #8671.
alexcrichton has enabled auto merge for PR #8671.
alexcrichton commented on PR #8671:
Ah I went ahead and just pushed up a commit to ignore s390x/riscv64, I don't think it's too critical to get all the architectures tested here
alexcrichton merged PR #8671.
Last updated: Dec 23 2024 at 12:05 UTC