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

Not handling spdy agent error event #137

Closed
AdamMagaluk opened this issue Jan 30, 2015 · 2 comments
Closed

Not handling spdy agent error event #137

AdamMagaluk opened this issue Jan 30, 2015 · 2 comments

Comments

@AdamMagaluk
Copy link
Collaborator

In lib/peer_socket we're setting a spdy agent but not handling the error event on it. See: https://github.com/zettajs/zetta/blob/master/lib/peer_socket.js#L121-L133

I saw this repeatably throw when continually connecting and disconnecting a peer.

Example to make the cloud throw a ECONNRESET or other error.

var zetta = require('zetta');

var z = zetta()
  .link('http://localhost:5000')
  .listen(5002, function() {
    setInterval(function(){ 
      z._peerClients.forEach(function(p) {
        p._ws.close();
      })
    }, 1000)
  });

We can handle the error like: PR coming soon.

this.agent.on('error', function(err) {
  self.close();
  self.emit('error', err);
})
@AdamMagaluk
Copy link
Collaborator Author

Cloud looks like:

var zetta = require('zetta');

zetta()
  .listen(5000);

@mdobson
Copy link
Contributor

mdobson commented Jan 30, 2015

Reproduced.

--
Matthew Dobson | apigee https://apigee.com/ | m: +1.734.634.5472 |
twitter @mdobs http://twitter.com/mdobs @apigee
https://twitter.com/apigee

On Fri, Jan 30, 2015 at 2:46 PM, Adam Magaluk [email protected]
wrote:

Cloud looks like:

var zetta = require('zetta');

zetta()
.listen(5000);


Reply to this email directly or view it on GitHub
#137 (comment).

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

2 participants