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

node-http-handler unexpected TimeoutError from socket #6271

Open
3 tasks done
nkomonen-amazon opened this issue Jul 11, 2024 · 5 comments
Open
3 tasks done

node-http-handler unexpected TimeoutError from socket #6271

nkomonen-amazon opened this issue Jul 11, 2024 · 5 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@nkomonen-amazon
Copy link

nkomonen-amazon commented Jul 11, 2024

Checkboxes for prior research

Describe the bug

We are using the @aws-sdk/client-sso-oidc which looks to use @smithy/node-http-handler. The core of the issue looks to be with @smithy/node-http-handler.

In the user telemetry of our products AWS Toolkit for VS Code and Amazon Q for VS Code, we sometimes see the error TimeoutError, with the message Connection timed out after 0 ms. It looks to be coming from setSocketTimeout. In our attempt to fix this we set a value of 30_000 in the requestTimeout field which is eventually used here, and then we started to instead see Connection timed out after 30000 ms. This seems to validate that the problem is coming from setSocketTimeout

The docs say that the timeout should be disabled at 0ms.

SDK version number

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

20+

Reproduction Steps

Cannot reproduce myself as it is sporadic, we see it in user telemetry though.

Minimal steps from my guess would be to:

  • create a NodeHttpHandler instance with requestTimeout at its default of 0
  • create a server which responds with multiple chunks of data, but with some arbitrary delay between each chunk (eg 1000ms)

My guess is that since the request has multiple chunks you will get a TimeoutError since it will timeout before the next chunk is sent???? Below in the Additional Context section it seems like the socketTimeout should reset when new chunks are received.

Observed Behavior

Unexpected TimeoutError

Expected Behavior

Don't get a TimeoutError

Possible Solution

It looks that in setSocketTimeout we still set the timeout even if it is 0. If we return early will this be enough to fix the issue?

Additional Information/Context

@nkomonen-amazon nkomonen-amazon added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 11, 2024
@aBurmeseDev
Copy link
Member

Hi @nkomonen-amazon - thanks for reaching out.

I'm not seeing any recent change to @smithy/node-http-handler that's relevant to what you're reporting, however you're on older version. See version history here. Can you try the recent version?

If issue persists, please provide minimal repro for us to further investigate. Feel free to cut internal SIM to the team as well.
Best,
John

@aBurmeseDev aBurmeseDev self-assigned this Jul 12, 2024
@aBurmeseDev aBurmeseDev added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jul 12, 2024
@nkomonen-amazon
Copy link
Author

nkomonen-amazon commented Jul 12, 2024

Hey John!

The code that I assume has an issue is over a year old, so I don't think a newer version is the fix. The issue is happening for a subset of our users, so I cannot reproduce the problem myself.

I've opened a SIM ticket as well.

Thanks!

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jul 13, 2024
@aBurmeseDev
Copy link
Member

aBurmeseDev commented Jul 29, 2024

Thanks for your response. Our team has received an internal ticket for further investigation. However, to better understand and examine the reported behavior, we request that you provide us with a minimal reproducible code snippet or example that demonstrates the problem. Additionally, any relevant logs or diagnostic information that could offer more insights into the issue would be extremely helpful for our analysis.

@aBurmeseDev aBurmeseDev added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jul 29, 2024
Copy link

github-actions bot commented Aug 9, 2024

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 9, 2024
@nkomonen-amazon
Copy link
Author

.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. labels Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants