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

Bug: Hangs up on cached action #135

Closed
caiiiycuk opened this issue May 27, 2013 · 3 comments
Closed

Bug: Hangs up on cached action #135

caiiiycuk opened this issue May 27, 2013 · 3 comments

Comments

@caiiiycuk
Copy link
Contributor

package quickstart.action

import xitrum.annotation.{CacheActionMinute, GET}

@GET("")
class SiteIndex extends DefaultLayout {
  def execute() {
    respondHtml("Normal")
  }
}

@CacheActionMinute(5)
@GET("cache")
class SiteIndexCached extends DefaultLayout {
  def execute() {
    respondHtml("Normal+Cache")
  }
}
  • sbt run -Dxitrum.mode=production
  • Open http://localhost:8000/cache and reload it number of times, sometimes xitrum responds immediately. But sometimes it hangs up and never responds.
@ngocdaothanh
Copy link
Member

Thanks for reporting.

With a quick test with httperf, it seems that there's problem with cache and keep alive requests (connection is reused). I will investigate more.

@ngocdaothanh
Copy link
Member

I've just fixed the problem.
A new version will be released immediately.

More info:

To protect the server from DOS, for one connection, Xitrum only processes one request at a time (HTTP pipelining is not supported). After a request is received, the connection is paused for receiving so that while the request is being processed, new requests will not be processed. After the request is processed and its response is sent out, the connection is resumed so that a new request may be processed.

For cached action, I forgot to resume after sending the response.

@caiiiycuk
Copy link
Contributor Author

Thanks

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