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

Stream result is broken. #994

Closed
phadej opened this issue Jun 24, 2018 · 1 comment
Closed

Stream result is broken. #994

phadej opened this issue Jun 24, 2018 · 1 comment

Comments

@phadej
Copy link
Contributor

phadej commented Jun 24, 2018

Because of the way things are engineered now, the connection is closed to early:

% cabal new-run servant-machines:example client 10 -- +RTS -s
Up to date
example: HttpExceptionRequest Request {
  host                 = "localhost"
  port                 = 8000
  secure               = False
  requestHeaders       = [("Accept","application/json;charset=utf-8")]
  path                 = "/get/10"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ConnectionClosed
       1,096,000 bytes allocated in the heap
           5,376 bytes copied during GC
          75,048 bytes maximum residency (1 sample(s))
          19,160 bytes maximum slop
               2 MB total memory in use (0 MB lost due to fragmentation)

See #991 for PoC.


My first thought is to re-engineer stream clients so it's user responsibility to remember to perform cleanup. Maybe we can add a finalizer on the response body stream to make it less error-prone. My logic: if you need more power (streaming), you'll have more responsibilities too.


EDIT: I run into various issues while working on #841 related to streaming, I'd try to tackle them separately, but there might be a big knot to untie.

@phadej phadej added this to the 0.15 milestone Jun 24, 2018
@phadej phadej mentioned this issue Jun 24, 2018
12 tasks
@phadej
Copy link
Contributor Author

phadej commented Nov 7, 2018

Fixed by #991

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

1 participant