Preliminary review: Adding tracing of I/O calls

Staffan Larsen staffan.larsen at oracle.com
Wed Nov 7 12:39:25 UTC 2012


On 4 nov 2012, at 16:13, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 04/11/2012 12:50, Staffan Larsen wrote:
>> :
>>> I realize the focus is blocking I/O for now but one thing to know is that timed read operations on socket adapters (the socket obtained by calling SocketChannel's socket method) configures the socket channel to be non-blocking so this means that this I/O will not be observed by the IoTraceListener.
>> I need some help to understand which call path you are referring to here. I see SocketChannelImpl.socket() returning a SocketAdapter, but I don't see how/if this is Socket is configured to be non-blocking.
> Socket s = sc.socket();
> s.setSoTimeout(5*1000);
> int n = s.getInputStream().read(ba);
> 
> This read is a blocking read, it's just that the underlying socket channel will be non-blocking so it will not be observed by the IoTraceListener.
> 
> This shouldn't be too common and might not be a big concern but I just wanted to point it out.

Ah, now I see what you mean. Tricky code :-)  I've added instrumentation to this path as well. 

Thanks,
/Staffan




More information about the core-libs-dev mailing list