Skip to content

No request timeout possibly means that sockets are being left open when queries fail #446

@richardkazuomiller

Description

@richardkazuomiller

I have a web app that running Node.js v0.10 and latest gcloud-node on multiple servers. I've run into two issues that occurred independent of one another but I think are symptoms of the same issue.

  1. Request callback on dataset.save was never called, so the subsequent requests I had queued to prevent contention were never run.
  2. Several instances of the same app, accessing the same dataset, became unable to access GCD at the same time. Requests to app timed out because gcloud-node was either not calling the callback function like in the first issue or requests to the datastore were not being sent at all.

Before restarting the processes, I checked to see what sockets were open

# netstat -n -a | grep ":443 "
tcp        0      0 108.61.163.81:52919     216.58.221.10:443       ESTABLISHED
tcp        0      0 108.61.163.81:40802     216.58.220.170:443      ESTABLISHED
tcp        0      0 108.61.163.81:52882     216.58.221.10:443       ESTABLISHED
tcp        0      0 108.61.163.81:38009     216.58.220.170:443      ESTABLISHED
tcp        0      0 108.61.163.81:40291     216.58.220.170:443      ESTABLISHED
tcp        0      0 108.61.163.81:40287     216.58.220.170:443      ESTABLISHED
tcp        0      0 108.61.163.81:35125     216.58.220.202:443      ESTABLISHED
tcp        0      0 108.61.163.81:50504     216.58.221.10:443       ESTABLISHED
tcp        0      0 108.61.163.81:50507     216.58.221.10:443       ESTABLISHED
tcp        0      0 108.61.163.81:34658     216.58.220.202:443      ESTABLISHED
tcp        0      0 108.61.163.81:37997     216.58.220.170:443      ESTABLISHED
tcp        0      0 108.61.163.81:50506     216.58.221.10:443       ESTABLISHED
tcp        0      0 108.61.163.81:52938     216.58.221.10:443       ESTABLISHED
tcp        0      0 108.61.163.81:38001     216.58.220.170:443      ESTABLISHED
tcp        0      0 108.61.163.81:40293     216.58.220.170:443      ESTABLISHED

In the output above, there are 15 connections to Google IPs, which remained open for several minutes before I restarted the Node processes. There are 15 because in Node 0.10 the default maxSockets for the global HTTP agent is 5, and there were three Node processes running on that machine.

Leaving these sockets open indefinitely seems like a problem that should be fixed on the server side of GCD, but as long as I'm not missing something I propose that there should be a timeout of a few seconds for all requests sent by gcloud-node.

Anyone have any thoughts related to any of that?

Thanks in advance.

Metadata

Metadata

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.coretriage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions