Comments (10)
+1 for this ticket. And I think it's about ECONNRESET too:
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: write ECONNRESET
at errnoException (net.js:769:11)
at Object.afterWrite (net.js:593:19)
from axon.
@visionmedia I am messing with this too, however it gets complicated. :-) Given that with EPIPE and ECONNRESET we did actually connect to the peer, but it broke mid-flight, meaning we did not fallback to enqueue()
. Wondering if we should re-tweak a few things to have any sockets that need to buffer actually always enqueue messages and have them removed upon an "ack" message from the peer... Not all the different from keeping track of a "callback stack" with req/rep.
Anyhow, you can reproduce easily with larger messages that will be chunked, then close() the peer: gjohnson@233bc1c
from axon.
good point, hmMmM.. I'm seeing
if (nbytes == -1 && (errno == ECONNRESET || errno == EPIPE ||
errno == ETIMEDOUT))
return -1;
in zmq's .write(), followed by the out_event():
// Handle problems with the connection.
if (nbytes == -1) {
error ();
return;
}
and
#if defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_FREEBSD
// Make sure that SIGPIPE signal is not generated when writing to a
// connection that was already closed by the peer.
int set = 1;
int rc = setsockopt (s, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof (int));
errno_assert (rc == 0);
in the constructor, seems like they just bail on errors as well
from axon.
I think it's easy to handle at least in pub/sub: just drop the message being sent like the socket had been already shut down prior to error.
from axon.
yeah agreed that's definitely the easy case
from axon.
That commit I referenced would do that, I can pull... it will just hide errors on the other sockets as a side-effect, for now at least.
from axon.
sounds good, we might have to mock some node internals to get a reproducible test case, that one just hung for me
from axon.
Here's a js that stably reproduces such errors, just uncomment corresponding line:
var net = require('net');
var server = net.createServer(function(c) {
c.write('hello\r\n');
c.pipe(c);
});
server.listen(8124, function() {});
var client = net.connect({port: 8124}, function() { //'connect' listener
//server.close(); // reproduces ECONNRESET
var msg = 'world';
client.write(msg);
//client.destroy(); // reproduces EPIPE
});
from axon.
@AlexeyKupershtokh awesome thanks I will try that out in a minute
from axon.
just ended up sneaking in some faux errors
from axon.
Related Issues (20)
- Get a callback on the send method
- Allow disabling of the queue HOT 1
- push/pull where pullers pull upon demand
- Support for multiple peers needs improvement HOT 2
- Error on connect for sub socket HOT 4
- subscribers cannot send messages HOT 1
- Send command
- socket.connect blocking gulp task from completing HOT 3
- Binding to UNIX sockets results with RangeError HOT 3
- Is this maintained? HOT 2
- How would I go about tracing RPC(req-rep) calls?
- update package JSON engine values HOT 1
- How to catch this error: read ECONNRESET HOT 1
- Impossible to handle server errors like 'EADDRINUSE' without 'domain'
- Missing typing definition
- `fs.unlink()` is used as if it was synchronous when deleting a stale UNIX socket
- unix socket reconnect fails HOT 2
- tls certificates ? HOT 1
- Deprecated prototypical inheritance
- Is it still maintained ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axon.