PUT over HTTP randomly fails #112

Closed
rawg opened this Issue Feb 1, 2012 · 19 comments

Projects

None yet
@rawg
rawg commented Feb 1, 2012

Using Nodejs 0.6.9, riak-js 0.4.1, Riak kv 1.0.2

With an HTTP client, when I PUT a document, the operation fails with the following error about two times out of three:
{ [Error: socket hang up] code: 'ECONNRESET' }

It looks related to this issue: nodejs/node-v0.x-archive#1135

If I switch to protocol buffers, I get this error:
Error: Cannot find module 'protobuf_for_node'

@nullobject

+1

It's randomly failing on Node 0.6.11 too. I understand that this may not be a RiakJS problem, but it seems whatever is causing this in Node isn't a regression. Currently my work around is to only use Node 0.6.8, which doesn't seem to exhibit the issue.

@rawg
rawg commented Feb 24, 2012

We ended up using a different solution, but you might try this:

http = require('http');

http.globalAgent.maxSockets = 100;

On Tue, Feb 21, 2012 at 2:30 PM, Josh Bassett <
reply@reply.github.com

wrote:

+1

It's randomly failing on Node 0.6.11 too. I understand that this may not
be a RiakJS problem, but it seems whatever is causing this in Node isn't a
regression. Currently my work around is to only use Node 0.6.8, which
doesn't seem to exhibit the issue.


Reply to this email directly or view it on GitHub:
https://github.com/frank06/riak-js/issues/112#issuecomment-4086721

@jroes
jroes commented Apr 5, 2012

+1

Definitely something between v0.6.8 and v0.6.9.

Running through the commits, I found this: nodejs/node-v0.x-archive@3df7c90

Which I believe is directly related.

@aniljava
aniljava commented May 9, 2012

Problem exists in Node v0.6.15 as well.

@rawg http.globalAgent.maxSockets = 100; fails if number of consecutive PUT request is large.

@aniljava
aniljava commented May 9, 2012

This might help
geeklist@817194a

@brodo
brodo commented Jul 30, 2012

I ran into this issue and setting the header to keep-alive fixed it for me. However, I'm unsure if I should leave it like that because of the comment which talks about "lot of weird errors in tests". What would you guys recommend? Is there another workaround?

@palmerabollo

I am facing the same problem with node 0.8.1 and riak-js 0.4.1 with riak 1.1.2, if that helps solving the issue.

@seanjsong

+1
I am facing the same problem with node 0.8.8 and riak-js 0.4.1 with riak 1.2.1.

@KasperTidemann

+1, exactly the same issue I'm seeing locally running node v0.8.12, riak-js v0.41, and riak v1.2.1.

@roidrage
Contributor
roidrage commented Nov 6, 2012

Just chiming in to check whether merging #3 would be something everyone would be interested in?

We're in the process of promoting the new implementation, and it doesn't include explicit connection closing by default, so it should resolve this issue as well.

@roidrage
Contributor

The new implementation has connection: close removed from the defaults, so from the feedback in this thread, that should fix the issue.

Feel free to reopen if you're still seeing issues with this.

@roidrage roidrage closed this Nov 18, 2012
@djrenren

I'm seeing this error on node 0.10.3...

@roidrage
Contributor

@jmrenner which version of riak-js are you using?

@djrenren

I'm using riak-js@0.9.4pre3 and it's always dying for me on this request:

 db.get('posts', {url: urlName}, function(err, posts){
      console.log(arguments);
  });

where urlName is defined as "hi-there" (I've verified this).
It's important to note that manually I can request:

GET [domain]/buckets/posts/index/url_bin/hi-there

The record was created using riak-js. getAll() and save() are still working.
It just appears to be this request that fails.

EDIT: Oh and I'm using riak 1.3.1

@roidrage
Contributor

@jmrenner the get syntax you're using is not officially supported. Are you trying to fetch documents using a secondary index query?

@djrenren

Yeah I'm trying to use secondary indexes, that's the syntax I saw on riak-js.org

@roidrage
Contributor

That's the syntax for the query() function.

@djrenren

Wow... um... I'm really sorry about that... I've spent so long staring at this error and I somehow missed that. Thanks! and sorry!

@lukeivers

I don't have time to investigate right this second, hopefully I will in the near future, but I just definitely had this problem with node 0.11.2. Reverting to 0.11.0, with no other changes, immediately fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment