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

fix(credential-provider-imds): destroy request handle on promise resolve/reject #2452

Merged
merged 6 commits into from
Jun 17, 2021
Merged

fix(credential-provider-imds): destroy request handle on promise resolve/reject #2452

merged 6 commits into from
Jun 17, 2021

Conversation

samchungy
Copy link
Contributor

@samchungy samchungy commented Jun 1, 2021

Issue

#2451

Description

Issue in the credential-provider-imds package.

Kills the dangling open request handle in credential-provider-imds after the promise resolves or rejects. If it is not killed manually we are relying on Node.js to clean it up which can take a long time or just simply never done. In my tests, a successful request remained open for 16 hours on a buildkite build. This causes issues especially with testing libraries like Jest which wait for all handles to be closed.

Testing

How was this change tested?

  • Unit Tests
  • Locally
  • On BuildKite with Jest

Example Repo:
https://github.com/samchungy/jest-aws-sdk-v3-open-handle

Additional context


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@0f6548e). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2452   +/-   ##
=======================================
  Coverage        ?   59.55%           
=======================================
  Files           ?      493           
  Lines           ?    26374           
  Branches        ?     6265           
=======================================
  Hits            ?    15708           
  Misses          ?    10666           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f6548e...88531a7. Read the comment docs.

@samchungy samchungy changed the title fix: Destroy request upon promise resolve or reject fix(redential-provider-imds): Destroy request upon promise resolve or reject Jun 1, 2021
@samchungy samchungy changed the title fix(redential-provider-imds): Destroy request upon promise resolve or reject fix(credential-provider-imds): Destroy request upon promise resolve or reject Jun 1, 2021
@samchungy samchungy changed the title fix(credential-provider-imds): Destroy request upon promise resolve or reject fix(credential-provider-imds): Destroy request open handle upon promise resolve or reject Jun 1, 2021
@samchungy samchungy changed the title fix(credential-provider-imds): Destroy request open handle upon promise resolve or reject fix(credential-provider-imds): destroy request open handle upon promise resolve or reject Jun 3, 2021
Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, but needs to rebase.

@AllanZhengYP
Copy link
Contributor

/cc @trivikr

@trivikr trivikr merged commit 122c139 into aws:main Jun 17, 2021
@trivikr trivikr changed the title fix(credential-provider-imds): destroy request open handle upon promise resolve or reject fix(credential-provider-imds): destroy request handle on promise resolve/reject Jun 17, 2021
@github-actions
Copy link

github-actions bot commented Jul 2, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants