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

v2.3 of the JS driver fails in an ugly way when connecting to a RethinkDB 2.2 server #5667

Closed
mlucy opened this issue Apr 14, 2016 · 8 comments
Assignees
Milestone

Comments

@mlucy
Copy link
Member

mlucy commented Apr 14, 2016

From the mailing list:

error: uncaughtException: Unexpected token E date=Thu Apr 14 2016 02:22:24 GMT+0000 (UTC), pid=1728, uid=441, gid=444, cwd=/mnt/app, execPath=/mnt/app/.modulus/nvm/versions/node/v5.10.1/bin/node, version=v5.10.1, argv=[/mnt/app/.modulus/nvm/versions/node/v5.10.1/bin/node, /mnt/app/app.js], rss=74043392, heapTotal=60116256, heapUsed=31038328, loadavg=[20.7158203125, 21.318359375, 21.66748046875], uptime=623818, trace=[column=null, file=null, function=Object.parse, line=null, method=parse, native=true, column=35, file=/mnt/app/node_modules/rethinkdb/net.js, function=Socket.handshake_callback, line=624, method=handshake_callback, native=false, column=13, file=events.js, function=emitOne, line=90, method=null, native=false, column=7, file=events.js, function=Socket.emit, line=182, method=emit, native=false, column=18, file=_stream_readable.js, function=readableAddChunk, line=153, method=null, native=false, column=10, file=_stream_readable.js, function=Socket.Readable.push, line=111, method=Readable.push, native=false, column=20, file=net.js, function=TCP.onread, line=529, method=onread, native=false], stack=[SyntaxError: Unexpected token E,     at Object.parse (native),     at Socket.handshake_callback (/mnt/app/node_modules/rethinkdb/net.js:624:35),     at emitOne (events.js:90:13),     at Socket.emit (events.js:182:7),     at readableAddChunk (_stream_readable.js:153:18),     at Socket.Readable.push (_stream_readable.js:111:10),     at TCP.onread (net.js:529:20)]
{ name: 'SyntaxError',
  message: 'Unexpected token E',
  stack: 'SyntaxError: Unexpected token E\n    at Object.parse (native)\n    at Socket.handshake_callback (/mnt/app/node_modules/rethinkdb/net.js:624:35)\n    at emitOne (events.js:90:13)\n    at Socket.emit (events.js:182:7)\n    at readableAddChunk (_stream_readable.js:153:18)\n    at Socket.Readable.push (_stream_readable.js:111:10)\n    at TCP.onread (net.js:529:20)',
  timestamp: 1460600544679 }

@nighelles, you did the JS implementation of the new handshake, right? It might be nice to produce a friendlier error here if it's easy.

@mlucy mlucy added this to the 2.3.x milestone Apr 14, 2016
@mlucy
Copy link
Member Author

mlucy commented Apr 14, 2016

We should probably check the other two drivers as well at some point.

@nighelles
Copy link

This is fixed in next.

@mglukhovsky
Copy link
Member

Should we prepare a point release of the JS driver?

On Apr 14, 2016, at 6:56 PM, Nighelles David notifications@github.com wrote:

Closed #5667.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@danielmewes
Copy link
Member

@nighelles can you cherry-pick to v2.3.x please? It will go into the next point release then.

@nighelles
Copy link

This is in v2.3.x

@thomasmodeneis
Copy link

Hi,

I have rethinkdb 2.3.1 and I just ran into something similar to this that the ticket is reporting,

error: uncaughtException: read ECONNRESET date=Tue May 24 2016 01:48:48 GMT+0200 (CEST), pid=76930, uid=501, gid=20, cwd=/opt/test123, execPath=/usr/local/bin/node, version=v5.6.0, argv=[/usr/local/bin/node, /opt/test123/app/server], rss=90857472, heapTotal=66259744, heapUsed=49247000, loadavg=[1.591796875, 1.76025390625, 1.99755859375], uptime=3162541, trace=[column=11, file=util.js, function=exports._errnoException, line=856, method=_errnoException, native=false, column=26, file=net.js, function=TCP.onread, line=546, method=onread, native=false], stack=[Error: read ECONNRESET,     at exports._errnoException (util.js:856:11),     at TCP.onread (net.js:546:26)]

I could not find anything in the documentation referring to retries when the connection with the database fails with such error, this is causing my entire app to be taken down and so I would really appreciate if someone could give me a hint for the retry strategy with this driver.
Thank you.

@danielmewes
Copy link
Member

@thomasmodeneis The driver doesn't handle reconnects at all. You'll need to catch the exception and call reconnect in your application code.
Alternatively you can check out rethinkdbdash https://github.com/neumino/rethinkdbdash which is mostly compatible to the official JavaScript driver, but comes with a connection pool and automatic reconnects.

@thomasmodeneis
Copy link

Very nice module this rethinkdbdash, thanks for the hint @danielmewes :)
Cheers

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

No branches or pull requests

5 participants