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

hystrix.stream holds connection open if no metrics #85

Closed
benjchristensen opened this issue Jan 9, 2013 · 1 comment
Closed

hystrix.stream holds connection open if no metrics #85

benjchristensen opened this issue Jan 9, 2013 · 1 comment
Labels
Milestone

Comments

@benjchristensen
Copy link
Contributor

If a server has not yet had any command executions to generate metrics the hystrix.stream servlet will loop infinitely waiting on metrics.

Since it keeps looping with no data it will never attempt writing to the outputstream.

Thus, it will never close the connection even if the client disconnects as it won't get an IOException or call close().

This will keep the servlet inside the try/catch and never count down the counter.

@benjchristensen
Copy link
Contributor Author

Here is how the problem manifested itself:

$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 503 MaxConcurrentConnections reached: 5</title>
</head>
<body><h2>HTTP ERROR 503</h2>
<p>Problem accessing /hystrix-examples-webapp/hystrix.stream. Reason:
<pre>    MaxConcurrentConnections reached: 5</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>                                                
<br/>                                                
<br/>        

Now it looks like this with the ping that detects a connection closing:


$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

^C
$ curl http://localhost:8989/hystrix-examples-webapp/hystrix.stream
ping: 

ping: 

ping: 

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

No branches or pull requests

1 participant