JDK-4504001 : Check NIO native code to ensure that it restarts any sys calls
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 1.4.0,1.4.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,linux
  • CPU: generic
  • Submitted: 2001-09-18
  • Updated: 2010-02-23
  • Resolved: 2005-02-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_07 b02Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
The NIO native code should be examined to see if there are any
placed where it should restart following interruption by a 
signal -- ie: any system calls that return EINTR.

Specifically the following should be reviewed on Solaris/Linux :-

- SocketChannelImpl.accept as accept is not automatically 
restarted

- Selector implementor based on "poll" may not be automatically
started (SocketChannel.finishConnect also; /dev/poll should be
okay because ioctl is automatically restarted).


Further notes :-

4178050 & 4425033 were recently fixed in HotSpot to ensure that system
calls are transparent restarted.  This addresses the issue for
legacy networking as it must use HPI for blocking I/O (to get
the interruptable I/O semantics on Solaris).

Solaris lwp signal handler redirects process signal (such as 
SIGPIPE). The "alogrithm" it uses to pick a thread makes it
more likely to pick a blocked thread.

If poll is interrupted and transparently restart it may be
necesary to adjust the timeout -- eg: if EINTR after x ms
then need to restart poll with timeout-x ms.


Comments
EVALUATION Yes, this will be done. -- ###@###.### 2002/4/16 Many cases were checked and fixed in the changes for 4460583/4470470, but a few still remain. -- ###@###.### 2002/4/22 Was putback into 1.4.2_07b02 described with both bug# 500121, 4504001 -- Lew Yobs 2005-02-14 ###@###.### 2005-2-15 05:49:37 GMT
04-10-0188