Re: Infinite Loop in KeepAliveStream

2012-12-18 Thread Martin Buchholz
Pushed. On Mon, Dec 17, 2012 at 11:18 PM, Chris Hegarty wrote: > Thank you Martin, looks good. > > -Chris > > On 18 Dec 2012, at 02:45, Martin Buchholz wrote: > > I created a webrev > > > http://cr.openjdk.java.net/~martin/webrevs/openjdk8/KeepAliveStream-infloop/ > > incorporating Chris' test a

Re: Infinite Loop in KeepAliveStream

2012-12-17 Thread Chris Hegarty
Thank you Martin, looks good. -Chris On 18 Dec 2012, at 02:45, Martin Buchholz wrote: > I created a webrev > > http://cr.openjdk.java.net/~martin/webrevs/openjdk8/KeepAliveStream-infloop/ > > incorporating Chris' test and propose to push this change to > ssh://mar...@hg.openjdk.java.net/jdk8

Re: Infinite Loop in KeepAliveStream

2012-12-17 Thread Martin Buchholz
I created a webrev http://cr.openjdk.java.net/~martin/webrevs/openjdk8/KeepAliveStream-infloop/ incorporating Chris' test and propose to push this change to ssh://mar...@hg.openjdk.java.net/jdk8/tl-gate/jdk

Re: Infinite Loop in KeepAliveStream

2012-12-16 Thread Chris Hegarty
On 15/12/2012 01:56, Martin Buchholz wrote: ... I was trying to avoid ever calling skip with a larger argument than available(), trying to obey the comment // Do this ONLY if the skip won't block. So my version feels safer, although again I don't have the full context. OK, makes sense. I'm ok

Re: Infinite Loop in KeepAliveStream

2012-12-14 Thread Martin Buchholz
On Thu, Dec 13, 2012 at 7:26 AM, Chris Hegarty wrote: > I think what you suggested should work. But how about a simpler version? > > > > if (expected > count) { > long nskip = expected - count; > if (nskip <= available()) { > -long

Re: Infinite Loop in KeepAliveStream

2012-12-13 Thread Chris Hegarty
I think what you suggested should work. But how about a simpler version? if (expected > count) { long nskip = expected - count; if (nskip <= available()) { -long n = 0; -while (n < nskip) { -

Re: Infinite Loop in KeepAliveStream

2012-12-12 Thread Martin Buchholz
On Tue, Dec 11, 2012 at 7:40 AM, Chris Hegarty wrote: > Hi Martin, > > Thank you for reporting this issue. I filed 8004863: "Infinite Loop in > KeepAliveStream", to track it. > > I put together a small test to reproduce the problem (inline below). It is > racey, but shows the problem most of the t

Re: Infinite Loop in KeepAliveStream

2012-12-11 Thread Chris Hegarty
Hi Martin, Thank you for reporting this issue. I filed 8004863: "Infinite Loop in KeepAliveStream", to track it. I put together a small test to reproduce the problem (inline below). It is racey, but shows the problem most of the time on my machine. I tried your suggested patch, but found th