Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@huntc
Copy link
Contributor

@huntc huntc commented Jul 15, 2013

In 2.1.2 there seems to be an issue with detecting the end of an SSE stream.
In 2.1.1 connDeathWatch is called when connection ends, but not in 2.1.2.

More information: https://groups.google.com/forum/#!topic/play-framework/IUWTfhf8Si4
Version used: official 2.1.2 download
Environment: Sun/Oracle Java 1.7.0_25 (latest), both on OS X and Ubuntu 12.10
Code in question: matthiasn/sse-chat

@ghost ghost assigned huntc Jul 12, 2013
@huntc
Copy link
Contributor

huntc commented Jul 12, 2013

Thanks I'll take another look

@huntc
Copy link
Contributor

huntc commented Jul 14, 2013

I've managed to reproduce by using the 2.1.2 distribution directly. I'm unsure why my customised build using the 2.1.2 tag isn't working though... I shall look further as it is important to be able to prove that any fix on 2.1.x actually fixes the issue.

@huntc
Copy link
Contributor

huntc commented Jul 15, 2013

I think I've found the problem - it has something to do with the re-factorings that were done around the upstream handler Take this bit of code of the upstream handler:

Iteratee.flatten(
  NettyPromise(future)
    .map(_ => if (ctx.getChannel.isConnected()) Cont(step) else Done((), Input.Empty)))

map is called only on success of course. If there's failure i.e. the connection dies (which it will for this scenario) then the Iteratee will not be completed with a Done.

There must be some difference in the code we package in order to mask a race condition. I shall attend to a fix, though it may be tricky to reproduce!

@huntc
Copy link
Contributor

huntc commented Jul 15, 2013

Here's a patch for review on the 2.1.x branch. I'll also create a PR and attach it to this issue for the master branch - the changes will be different for master.
screen shot 2013-07-15 at 3 27 59 pm

@jroper
Copy link
Member

jroper commented Jul 15, 2013

LGTM

huntc added a commit that referenced this pull request Jul 15, 2013
…res were not permitting an iteratee to be completed. This caused a particular issue with respect to chunked replies.
…tee to be completed. This caused a particular issue with respect to streamed replies.
@cloudbees-pull-request-builder

play2-master-PRs #364 SUCCESS
This pull request looks good

@huntc
Copy link
Contributor

huntc commented Jul 15, 2013

Just as a footnote to this issue, I was finally able to package a 2.1.x release and reproduce the issue. I then applied my 2.1.x fix, packaged again and re-tested. The issue appeared to be resolved.

jroper added a commit that referenced this pull request Jul 15, 2013
@jroper jroper merged commit 2fd5786 into playframework:master Jul 15, 2013
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

Successfully merging this pull request may close these issues.

3 participants