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: clear abort timeout after response was received #369

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

daniluk4000
Copy link
Contributor

πŸ”— Linked issue

#361

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #361.

Alternative PR to #362. Changes:

  • Didn't apply formatting
  • Clear timeout immediately after request, not after it's parsing

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@daniluk4000 daniluk4000 force-pushed the bugfix/361 branch 2 times, most recently from 699528c to 194c886 Compare March 1, 2024 14:32
@daniluk4000
Copy link
Contributor Author

@pi0 I have tested my fork on my big production project and this have stopped memory groving on my project, it doesn't go as high as 1-2GB and stops on ~400MB. If this could be reviewed & merged we would be so happy :)

@danielroe danielroe requested a review from pi0 March 21, 2024 12:16
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit 01eee82 into unjs:main Mar 21, 2024
1 of 4 checks passed
@daniluk4000 daniluk4000 deleted the bugfix/361 branch March 21, 2024 12:47
@pi0
Copy link
Member

pi0 commented Mar 21, 2024

Landed in 1.3.4, please let me know if it made any difference @daniluk4000

@daniluk4000 daniluk4000 restored the bugfix/361 branch March 21, 2024 12:52
@daniluk4000 daniluk4000 deleted the bugfix/361 branch March 21, 2024 12:52
@daniluk4000
Copy link
Contributor Author

Landed in 1.3.4, please let me know if it made any difference @daniluk4000

Appreciate it! I have already tested this in production, will update and re-test. Anyone using timeout + asyncContext + SSR should experience heavy memory decrease.

@daniluk4000
Copy link
Contributor Author

Works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setTimeout controlling the timeout is never cleared on response or error
2 participants