Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

dns/net: dns lookups cannot be unref'd #7149

Closed
bnoordhuis opened this issue Feb 19, 2014 · 3 comments
Closed

dns/net: dns lookups cannot be unref'd #7149

bnoordhuis opened this issue Feb 19, 2014 · 3 comments

Comments

@bnoordhuis
Copy link
Member

Sorry, I don't have a simple test case that won't involve mount binding /etc/resolv.conf but the issue is simple enough:

var net = require('net');
var conn = net.connect(80, 'quux', net.Socket.prototype.destroy);
conn.unref();  // Doesn't work anyway, see #7077.

If the resolver is slow to reply, the event loop remains alive for a potentially long time (glibc times out after 5-30 seconds, other resolvers may be worse.)

Somewhat related to #7077.

@tjfontaine
Copy link

I like the idea of cancelable and refable lookups and resolves, which I already have in my dns implementation. But that's a longer conversation for after 0.12.

It seems that similar to how internal timers are always unref'd we probably want any implicit lookups to be unrefd.

I would entertain a PR for this, maybe something that exposes the internal lookup with a flag indicating it should be unref'd?

@bnoordhuis
Copy link
Member Author

It would have to be fixed in libuv first because currently you can't unref requests. (At least, I never added that and it doesn't look like it's in there now.) I don't think I'll have time to work on that anytime soon but if e.g. @indutny wants to pick it up, I can review the PR.

@indutny
Copy link
Member

indutny commented Feb 26, 2014

Something for a future, perhaps, don't have time for this now.

@indutny indutny added this to the v0.13 milestone Feb 26, 2014
richardlau pushed a commit to ibmruntimes/node that referenced this issue Jun 17, 2016
Notable changes:

* **http**:
  - req.read(0) could cause incoming connections to stall and time out
    under certain conditions. (Fedor Indutny) [nodejs#7211](nodejs/node#7211)
  - When freeing the socket to be reused in keep-alive Agent wait for
    both prefinish and end events. Otherwise the next request may be
    written before the previous one has finished sending the body, leading
    to a parser errors. (Fedor Indutny) [nodejs#7149](nodejs/node#7149)
* **npm**: upgrade npm to 3.9.5 (Kat Marchán) [nodejs#7139](nodejs/node#7139)

nodejs/node#7323
richardlau pushed a commit to ibmruntimes/node that referenced this issue Jun 17, 2016
Notable changes:

* **http**:
  - req.read(0) could cause incoming connections to stall and time out
    under certain conditions. (Fedor Indutny) [nodejs#7211](nodejs/node#7211)
  - When freeing the socket to be reused in keep-alive Agent wait for
    both prefinish and end events. Otherwise the next request may be
    written before the previous one has finished sending the body, leading
    to a parser errors. (Fedor Indutny) [nodejs#7149](nodejs/node#7149)
* **npm**: upgrade npm to 3.9.5 (Kat Marchán) [nodejs#7139](nodejs/node#7139)

nodejs/node#7323
gibfahn pushed a commit to ibmruntimes/node that referenced this issue Jun 20, 2016
Notable changes:

* **http**:
  - req.read(0) could cause incoming connections to stall and time out
    under certain conditions. (Fedor Indutny) [nodejs#7211](nodejs/node#7211)
  - When freeing the socket to be reused in keep-alive Agent wait for
    both prefinish and end events. Otherwise the next request may be
    written before the previous one has finished sending the body, leading
    to a parser errors. (Fedor Indutny) [nodejs#7149](nodejs/node#7149)
* **npm**: upgrade npm to 3.9.5 (Kat Marchán) [nodejs#7139](nodejs/node#7139)

PR-URL: nodejs/node#7323
@Trott Trott closed this as completed Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants