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

MetadataService ignoring timeout config #6042

Closed
3 tasks done
morwoen opened this issue May 1, 2024 · 4 comments
Closed
3 tasks done

MetadataService ignoring timeout config #6042

morwoen opened this issue May 1, 2024 · 4 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog

Comments

@morwoen
Copy link

morwoen commented May 1, 2024

Checkboxes for prior research

Describe the bug

The MetadataService from @aws-sdk/ec2-metadata-service package ignores timeout config. The config is initialised in the constructor but is never retrieved from the object here or here.

SDK version number

@aws-sdk/ec2-metadata-service@3.565.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v18.18.2

Reproduction Steps

const metaData = new MetadataService({
    httpOptions: {
      timeout: 2000
    },
  });

return metaData.request('/latest/meta-data/placement/region', {})

The above has to be run locally where there is no metadata service access.

Observed Behavior

Code hangs for over 30 seconds

Expected Behavior

After 2 seconds the code should return a rejected promise

Possible Solution

The config needs to be passed down to the HttpRequest.

Additional Information/Context

No response

@morwoen morwoen added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 1, 2024
@RanVaknin RanVaknin self-assigned this May 6, 2024
@RanVaknin
Copy link
Contributor

Hi @morwoen ,

Thanks for letting us know. This seems like an oversight. @siddsriv is taking a look.

All the best,
Ran~

@RanVaknin RanVaknin added p2 This is a standard priority issue queued This issues is on the AWS team's backlog and removed needs-triage This issue or PR still needs to be triaged. labels May 7, 2024
@siddsriv
Copy link
Contributor

thanks for reporting this, timeout config option been added for requests. closing this issue, feel free to create a new one if you encounter any other issues.

@morwoen
Copy link
Author

morwoen commented May 10, 2024

Thanks @siddsriv , could you confirm which version the fix is in?

@morwoen
Copy link
Author

morwoen commented May 13, 2024

Found it :) https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.574.0

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 queued This issues is on the AWS team's backlog
Projects
None yet
Development

No branches or pull requests

3 participants