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

net: defer self.destroy calls to nextTick #1

Closed
wants to merge 1 commit into from

Conversation

anilhelvaci
Copy link
Owner

@anilhelvaci anilhelvaci commented Sep 7, 2024

Wrote tests for the suggested fix in nodejs#48771 (comment)

Fixes: nodejs#48771

What is the problem being solved?

#XXX Reported request object returned from http.request method cannot catch error events triggered when there’s an immediate failure trying to connect to an address returned from dns lookup.

Solution

#PR implemented changes suggested in #Comment. However the pr_number couldn’t be merged due to lack of tests(#commet-test-request). In this PR, I apply the same fix but with some tests.

Testing Considerations

All process.nextTick(() => self.destroy()) are hit except one.

@anilhelvaci anilhelvaci force-pushed the fix-48771-net-exception-with-tests branch from c8694f5 to 4725298 Compare September 9, 2024 06:37
@anilhelvaci anilhelvaci closed this Sep 9, 2024
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.

Conditional unhandled 'error' event when http.request with .lookup
1 participant