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

Got "Can't send request after GOAWAY" error #278

Open
richardkazuomiller opened this issue Sep 23, 2016 · 2 comments
Open

Got "Can't send request after GOAWAY" error #278

richardkazuomiller opened this issue Sep 23, 2016 · 2 comments

Comments

@richardkazuomiller
Copy link

I'm making requests using [email protected] to make requests to an HTTP2 server (Google Cloud Load Balancing) and the error Can't send request after GOAWAY was thrown and the process crashed.

How can I handle this so the client can make a new connection when the server wants it to "go away"? Is there some kind of GOAWAY event fired so I can create a new agent or something?

@richardkazuomiller
Copy link
Author

richardkazuomiller commented Sep 23, 2016

I did some digging and found that spdyAgent._spdyState.connection._spdyState.goaway is a thing. If that's truthy !== false, I create a new agent before making a request, and that seems to make things better. Does that make sense? I'm not super familiar with the details of the h2 spec.

I think reconnection should either be done automatically by the agent or there should be a more obvious way to figure out if an agent needs to reconnect.

@richardkazuomiller
Copy link
Author

Update in case anyone reads this and uses my solution:

_spdyState.goaway can sometimes be 0 if GOAWAY is the first thing it receives so checking if goaway is truthy is not good enough – it must be not false.

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

No branches or pull requests

1 participant