RandomAccessFile and futex ETIMEDOUT

G

ghostwhoowalks

Hi All

I see 52 ms being spent in calls to readFully() method of the
RandomAccessFile. I ran strace against my process and figured that
these weren't reads going to disk. All reads were being served from
the buffer cache (verified by running iostat). It also looks like the
52 ms is a futex timeout but strace doesn't report which system call
causes this. I was wondering if anyone has seen this problem before
and how do I go about addressing this? Do I have access to the source
code of the native library used by RandomAccessFile? Here is the
output from strace (the offending line is in bold):


29673 16:36:47.747658
futex(0x2aac3f62a674, FUTEX_WAIT, 1, {0, 49972000} <unfinished
....>
29716 16:36:47.784379 <... futex
resumed> ) = -1 ETIMEDOUT (Connection timed out)
<0.044427>
29716 16:36:47.784469
futex(0x2aac3f66e328, FUTEX_WAKE, 1) = 0
<0.000012>
29716 16:36:47.784548
clock_gettime(CLOCK_REALTIME, {1197938207, 784565000}) = 0
<0.000012>
29716 16:36:47.784610
futex(0x2aac3f670314, FUTEX_WAIT, 1, {0, 19970000} <unfinished
....>
29673 16:36:47.799354 <... futex
resumed> ) = -1 ETIMEDOUT (Connection timed out)
<0.051676>
29673 16:36:47.799392
futex(0x2aac3f2a7228, FUTEX_WAKE, 1) = 0
<0.000011>
29673 16:36:47.799434
clock_gettime(CLOCK_MONOTONIC, {6497274, 522227024}) = 0
<0.000007>
29673 16:36:47.799481
clock_gettime(CLOCK_MONOTONIC, {6497274, 522275024}) = 0
<0.000007>

Thanks
Avinash
 
A

Andrew Thompson

I see 52 ms being spent in calls to readFully() method of the
RandomAccessFile.

What RAF? How big is it?
..I ran strace against my process and figured that
these weren't reads going to disk. All reads were being served from
the buffer cache (verified by running iostat). It also looks like the
52 ms is a futex timeout but strace doesn't report which system call
causes this. I was wondering if anyone has seen this problem before
and how do I go about addressing this? Do I have access to the source
code of the native library used by RandomAccessFile?

That is hard for me to say. It is accessible to *me* in
the JDK directories under 'Program Files/Java/jdkN.N.N/src.zip'
where it is on your sytem, and whether you can find it and
tolerate the license - is a matter between you and your God.
...Here is the
output from strace (the offending line is in bold):

No, it is not in bold. Usenet does not understand bold,
though some news clients will render this *bold,* this
/italic,/ and this _underlined._

--
Andrew Thompson
http://www.physci.org/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200712/1
 
G

ghostwhoowalks

(e-mail address removed) wrote:

..


What RAF? How big is it?


That is hard for me to say. It is accessible to *me* in
the JDK directories under 'Program Files/Java/jdkN.N.N/src.zip'
where it is on your sytem, and whether you can find it and
tolerate the license - is a matter between you and your God.


No, it is not in bold. Usenet does not understand bold,
though some news clients will render this *bold,* this
/italic,/ and this _underlined._

Data being read is around 14MB in size. Like I said it is coming from
the buffer cache and not a physical disk read. I have verified this by
running iostat. By code, I meant the native code of RAF. Not the Java
sources. Is the native code available to me? Java sources do not tell
me anything whatsoever about who is calling into the futex. Line in
bold was supposed to be this one:

29673 16:36:47.799354 <... futex resumed> ) = -1 ETIMEDOUT
(Connection timed out) <0.051676>

futex is timing out after close 52 ms.

A
 
A

Andrew Thompson

Data being read is around 14MB in size. ..

OK. 'Not very big'.
..Like I said it is coming from
the buffer cache and not a physical disk read. I have verified this by
running iostat. By code, I meant the native code of RAF. Not the Java
sources.

Oh right, you noticed the (publicly available) source
usually 'fades out' (goes into native's etc.) at all the
interesting bits.

That raises an interesting question that (though a little
tangential) sort of mirrors your own.

For those knowledgable about the 'open sourcing' of
Java - just how much of Java does that include, is it
only the (already available via. the SDK source) code?

I am particularly interested in the source to the javax.jnlp
API (which is not included in the J2SE sources at all),
but would also be interested in hearing about the other
'hidden' (mostly com.sun.* stuff) sources used by the JRE.
..Is the native code available to me?

I do not know the answer to that. It was not available
in the past, but there is a major push to 'open source'
Java, alluded to above.
..Java sources do not tell
me anything whatsoever about who is calling into the futex. Line in
bold was supposed to be this one:

29673 16:36:47.799354 <... futex resumed> ) = -1 ETIMEDOUT
(Connection timed out) <0.051676>

Thanks for clarifying. Hope you get a solution. (In case
you have not figured it out yet, I was just trying to get a
bit of extra information that might assist others to help
better - I am not the 'guru with a solution'.)

--
Andrew Thompson
http://www.physci.org/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200712/1
 
G

Gordon Beaton

I see 52 ms being spent in calls to readFully() method of the
RandomAccessFile. I ran strace against my process and figured that
these weren't reads going to disk. All reads were being served from
the buffer cache (verified by running iostat). It also looks like
the 52 ms is a futex timeout but strace doesn't report which system
call causes this.

ltrace might, if you have it.

It might also help to identify exactly what Unix you're using since it
isn't clear from your post (or your headers, which indicate Windows).

There used to be some futex-related hangs with some combinations of
Java and glibc on Linux that could be worked around by setting
LD_ASSUME_KERNEL appropriately, perhaps this is related.

I can't offer much more here other than to say this doesn't really
sound like a Java issue, try asking in an OS specific newsgroup.

/gordon

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top