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 timeout error firing even though it's cancelled #2399

Merged
merged 12 commits into from
Feb 10, 2025

Conversation

paulrutter
Copy link
Contributor

@paulrutter paulrutter commented Jan 30, 2025

This is fixes #2248, as supplied by @thegedge earlier. See the original issue for a description of the issue and the proposed solution.

It's hard to add a unit test for this behavior, as it involves blocking the event loop for a certain amount of time.
Let me know if this is something that would be considered or if there are any concerns.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.

@paulrutter paulrutter changed the title Fix for #2248; Fix for #2248; busy event loop can cause events to fire while they shouldn't Jan 30, 2025
@paulrutter
Copy link
Contributor Author

I do see some failed tests, so probably this change is not entirely backwards compatible.
https://github.com/sindresorhus/got/actions/runs/13049814941/job/36407379410

source/core/timed-out.ts Outdated Show resolved Hide resolved
source/core/timed-out.ts Show resolved Hide resolved
source/core/timed-out.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 7a92064 into sindresorhus:main Feb 10, 2025
1 check passed
@sindresorhus sindresorhus changed the title Fix for #2248; busy event loop can cause events to fire while they shouldn't Fix timeout error firing even though it's cancelled Feb 10, 2025
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.

Connect timeout fired even though underlying socket is actually connected
3 participants