Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-13 Thread Chris Hegarty
nd no "#include " would be needed in SocketInputStream.c - >>> maybe not even now as it is. >>> >>> Best regards >>> Christoph >>> >>> >>>> -Original Message----- >>>> From: Vyom Tewari [ >>>

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-08 Thread Vyom Tewari
stag, 8. September 2016 05:20 To: Langer, Christoph <christoph.lan...@sap.com> Cc: net-dev@openjdk.java.net Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set Hi All, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.5/index.html

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-08 Thread Langer, Christoph
stoph.lan...@sap.com> > Cc: net-dev@openjdk.java.net > Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with > soTimeout set > > Hi All, > > Please find the latest > webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.5/index.html > <http://c

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-08 Thread Vyom Tewari
t-dev@openjdk.java.net; Chris Hegarty <chris.hega...@oracle.com> Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set Hi Chris, Sorry I was mostly focusing on our test failure first, i will check your suggestions. Thanks, Vyom On Wednesday 07 Sep

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-08 Thread Vyom Tewari
Original Message- From: Vyom Tewari [mailto:vyom.tew...@oracle.com] Sent: Mittwoch, 7. September 2016 18:31 To: Langer, Christoph <christoph.lan...@sap.com> Cc: net-dev@openjdk.java.net; Chris Hegarty <chris.hega...@oracle.com> Subject: Re: RFR 8075484:SocketInputStream.socketRead0

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-08 Thread Langer, Christoph
Tewari [mailto:vyom.tew...@oracle.com] > Sent: Mittwoch, 7. September 2016 18:31 > To: Langer, Christoph <christoph.lan...@sap.com> > Cc: net-dev@openjdk.java.net; Chris Hegarty <chris.hega...@oracle.com> > Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang eve

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Vyom Tewari
e: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set Hi All, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.4/index.html <http://cr.openjdk.java.net/%7Evtewari/8075484/webrev0.4/index.html>). there were some test failures in JPRT an

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Langer, Christoph
ri > Sent: Mittwoch, 7. September 2016 17:10 > To: Chris Hegarty <chris.hega...@oracle.com> > Cc: net-dev@openjdk.java.net > Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with > soTimeout set > > Hi All, > > Please find the latest > webre

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Vyom Tewari
Hi All, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.4/index.html ). there were some test failures in JPRT and Chris also pointed the same issue in modified code. Now with latest code

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Langer, Christoph
'Vyom Tewari' <vyom.tew...@oracle.com> > Cc: net-dev@openjdk.java.net; Chris Hegarty <chris.hega...@oracle.com> > Subject: RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with > soTimeout set > > Hi Vyom, > > I'll do an AIX build with your patch an

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Chris Hegarty
On 07/09/16 07:45, Vyom Tewari wrote: Hi Chris, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.3/index.html ). I did some code refactoring, JPRT is in progress. In terms of NET_Timeout**,

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Langer, Christoph
rty <chris.hega...@oracle.com> > Cc: net-dev@openjdk.java.net > Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with > soTimeout set > > Hi Chris, > > Please find the latest > webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.3/index.html >

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-07 Thread Vyom Tewari
Hi Chris, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.3/index.html ). I did some code refactoring, JPRT is in progress. I need help from some one to build and test latest changes on

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-06 Thread Mark Sheppard
my error ... i perceived NET_Timeout as a common function across all platforms otherwise I would have suggested a NET_TimeoutWithCurrentTime for each platform. providing a version of NET_Timeout with a recv function sound good, but will require a version per platform (NET_TimeoutWithRecv)

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-06 Thread Vyom Tewari
On Tuesday 06 September 2016 06:25 PM, Chris Hegarty wrote: Vyom, On 6 Sep 2016, at 10:20, Vyom Tewari wrote: Hi, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.2/index.html

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-06 Thread Chris Hegarty
Vyom, > On 6 Sep 2016, at 10:20, Vyom Tewari wrote: > > Hi, > > Please find the latest > webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.2/index.html > ). I have > incorporated the review

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-06 Thread Dmitry Samersoff
Vyom, Looks good for me! SocketInputStream.c:68 It's better to check for both EAGAIN and EINTR after poll() (no need to re-review). -Dmitry On 2016-09-06 12:20, Vyom Tewari wrote: > Hi, > > Please find the latest > webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.2/index.html >

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-06 Thread Mark Sheppard
looks fine ... thanks regards Mark On 06/09/2016 10:20, Vyom Tewari wrote: Hi, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.2/index.html ). I have incorporated the review comments.

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-06 Thread Vyom Tewari
Hi, Please find the latest webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.2/index.html ). I have incorporated the review comments. Thanks, Vyom On Monday 05 September 2016 08:37 PM, Chris Hegarty wrote: On

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-05 Thread Chris Hegarty
On 05/09/16 15:37, Mark Sheppard wrote: if the desire is to avoid making double calls on gettimeofday in the NET_ReadWithTimeout's while loop for its main call flow, Yes, the desire is to make no more calls to gettimeofday, than are already done. then consider a modification to NET_Timeout

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-05 Thread Mark Sheppard
if the desire is to avoid making double calls on gettimeofday in the NET_ReadWithTimeout's while loop for its main call flow, then consider a modification to NET_Timeout and create a version int NET_TimeoutWithCurrentTime(int s, long timeout, stuct timeval * current_time) int

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-05 Thread Chris Hegarty
Vyom, >>> webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.1/index.html There is some concern about the potential performance effect, etc, of gettimeofday, maybe there is a way out of this. The reuse of NET_Timeout is good, but it also calls gettimeofday. It seems that a specific

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-02 Thread Dmitry Samersoff
Vyom, > thanks for review, I did consider to use a monotonically increasing > clock like "clock_gettime" but existing nearby code("NET_Timeout") > uses "gettimeofday" so i choose to be consistent with the existing > code. OK. The fix looks good for me. -Dmitry On 2016-09-02 06:39, Vyom

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-01 Thread Vyom Tewari
hi Dimitry, thanks for review, I did consider to use a monotonically increasing clock like "clock_gettime" but existing nearby code("NET_Timeout") uses "gettimeofday" so i choose to be consistent with the existing code. Thanks, Vyom On Friday 02 September 2016 01:38 AM, Dmitry

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-01 Thread Bernd Eckenfels
Am Thu, 1 Sep 2016 23:08:15 +0300 schrieb Dmitry Samersoff : > gettimeofday is affected by system time changes, so running ntpd can > cause unpredictable behavior of this code. Also it's rather expensive > syscall. At least on Linux It is actually not a syscall at

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-01 Thread Dmitry Samersoff
Vyom, Did you consider to use select() to calculate timeout instead of gettimeofday ? gettimeofday is affected by system time changes, so running ntpd can cause unpredictable behavior of this code. Also it's rather expensive syscall. -Dmitry On 2016-09-01 19:03, Vyom Tewari wrote: > please

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-01 Thread Langer, Christoph
+1 From: net-dev [mailto:net-dev-boun...@openjdk.java.net] On Behalf Of Mark Sheppard Sent: Donnerstag, 1. September 2016 19:51 To: Vyom Tewari <vyom.tew...@oracle.com>; net-dev@openjdk.java.net Subject: Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set H

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-09-01 Thread Vyom Tewari
please find the updated webrev(http://cr.openjdk.java.net/~vtewari/8075484/webrev0.1/index.html ). I incorporated the review comments. Thanks, Vyom On Tuesday 30 August 2016 04:11 PM, Mark Sheppard wrote: Hi perhaps

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-08-30 Thread Vyom Tewari
Hi Mark, Thanks for the review, even i don't like "goto" , i wanted to do code changes as less as possible(not even refactoring) and "goto" helped me in this. I will incorporate the review comment and send the modified webrev. Thanks, Vyom On 8/30/2016 4:11 PM, Mark Sheppard wrote: Hi

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-08-30 Thread Mark Sheppard
Hi perhaps there is an opportunity to do some refactoring here (... for me a "goto " carries a code smell! ) along the lines if (timeout) { nread = NET_ReadWithTimeout(...); } else { nread = NET_Read(...); } the NET_ReadWithTimeout (...) function will contain a restructuring

Re: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-08-29 Thread Vyom Tewari
gentle reminder, please review the below code change. Vyom On Monday 22 August 2016 05:12 PM, Vyom Tewari wrote: Hi All, Please review the code changes for below issue. Bug : https://bugs.openjdk.java.net/browse/JDK-8075484 webrev:

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-08-22 Thread Langer, Christoph
tInputStream.socketRead0 can hang even with > soTimeout set > > Hi Vyom, > > to me the change looks good, apart from a few minor cosmetical remarks: > > in SocketInputStream.c (new): > line 71: if (_timeout > 0) { > -> I think the if is indented by one space too mu

RE: RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

2016-08-22 Thread Langer, Christoph
Hi Vyom, to me the change looks good, apart from a few minor cosmetical remarks: in SocketInputStream.c (new): line 71: if (_timeout > 0) { -> I think the if is indented by one space too much line 109: LABEL: if (_timeout) { -> as the length of "LABEL: " is more than 4 chars and hence the if is