Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.4.1
-
None
Description
I believe the Javascript driver is emitting connection refused errors in a manner that makes it difficult for users to add in retry and other error handling logic. My Javascript knowledge is minimal so apologies if the below examples are non-idiomatic Javascript.
Here's an example of the error:
UNCAUGHT: { Error: connect ECONNREFUSED 127.0.0.1:8182 at Object._errnoException (util.js:1022:11) at _exceptionWithHostPort (util.js:1044:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14) code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 8182 } UNCAUGHT: TypeError: Cannot read property 'aborted' of null at ClientRequest._req.on (/home/twilmes/repos/nodetest/node_modules/ws/lib/WebSocket.js:644:19) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at Socket.socketCloseListener (_http_client.js:363:9) at emitOne (events.js:121:20) at Socket.emit (events.js:211:7) at TCP._handle.close [as _onclose] (net.js:567:12)
I did some looking at that UNCAUGHT TypeError is a separate issue and appears to be fixed in a newer version of the WS package that is being used.
To reproduce this problem, you can either start an application up and point it at a non-existant TP enabled DB (JanusGraph in my case) or turn the graph off while the application is running. After this is done, an error is logged but the only way I'm able to catch it is to do something like this:
process.on('uncaughtException', function (err) { console.log("UNCAUGHT: ", err); });
Wrapping my queries and connection code in try/catch blocks does not catch anything.
Attachments
Attachments
Issue Links
- fixes
-
TINKERPOP-2197 gremlin javascript - Error: read ECONNRESET at TLSWrap.onStreamRead - websocket error
- Closed
- links to