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

Socket hang up #18

Closed
warseph opened this issue Mar 24, 2014 · 5 comments
Closed

Socket hang up #18

warseph opened this issue Mar 24, 2014 · 5 comments

Comments

@warseph
Copy link

warseph commented Mar 24, 2014

Hi,

I'm using the Streaming API, and got this error a couple of times:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: socket hang up
  at createHangUpError (http.js:1472:15)
  at CleartextStream.socketCloseListener (http.js:1522:23)
  at CleartextStream.EventEmitter.emit (events.js:117:20)
  at tls.js:696:10
  at process._tickCallback (node.js:415:13)

I'm handling the stream.on 'error' event, so I'm unsure if I'm missing something on my end or if there's an error not being handled by the library. The error happens sporadically, so it's hard to debug/reproduce.
I tried looking in the code, but didn't yet find anything that might be causing this, any ideas?

@michaelmcmillan
Copy link

Did you ever fix this? I have the same problem.

@warseph
Copy link
Author

warseph commented May 27, 2014

Hi @michaelmcmillan,
I couldn't really find the error.
What was causing it to happen more often was that my URL was sometimes malformed, due to some error in my coding. However, now that that's fixed, it still throws the error after longer periods (usually several days).
I did try to add error callbacks everywhere I could think of, still I couldn't catch the error.
I ended up using forks and domains for resiliency: http://nodejs.org/api/domain.html not the nicest solution, as I'd love to be able to handle this, but couldn't find any other way.
Please let me know if you find a solution!

@michaelmcmillan
Copy link

Thanks for the swift reply!

I also discovered that the errors were a result of my code sending in malformed data (specifically Object where it should have been an array). I still have not had the chance to see it running over a longer period, it remains to be seen if it dies.

I'll keep you posted if it crashes. Thanks again!

@warseph
Copy link
Author

warseph commented May 27, 2014

Great! Btw, i just checked, and in about 2 months running this only happened once, so it shouldn't be that much of a problem, I'll close the issue as now I can't really be sure it's caused by this library.
Cheers.

@warseph warseph closed this as completed May 27, 2014
@michaelmcmillan
Copy link

No problem Ezequiel!

On Tue, May 27, 2014 at 3:58 PM, Ezequiel Rabinovich <
notifications@github.com> wrote:

Closed #18 #18.


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#event-125105666
.

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

No branches or pull requests

2 participants