[PATCH] 7052549 "(aio) AssertionError in sun.nio.ch.PendingIoCache.clearPendingIoMap (win)"

Yuri Gaevsky ygaevsky at azulsystems.com
Tue Nov 5 10:29:02 PST 2013


Alan,

> Yuri - would you be able to test a patch for this to see if this resolves the issue you are seeing?

The failure is not reproducible anymore under fresh JDK-8 build when your patch applied.

Thank you,
-Yuri

-----Original Message-----
From: nio-dev-bounces at openjdk.java.net [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Yuri Gaevsky
Sent: Tuesday, November 5, 2013 6:14 PM
To: Alan Bateman
Cc: nio-dev at openjdk.java.net
Subject: RE: [PATCH] 7052549 "(aio) AssertionError in sun.nio.ch.PendingIoCache.clearPendingIoMap (win)"

Hi Alan,

Sure - I'll start the testing shortly.

Thanks,
-Yuri

-----Original Message-----
From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
Sent: Tuesday, November 5, 2013 3:42 PM
To: Yuri Gaevsky
Cc: nio-dev at openjdk.java.net
Subject: Re: [PATCH] 7052549 "(aio) AssertionError in sun.nio.ch.PendingIoCache.clearPendingIoMap (win)"

On 28/10/2013 15:03, Alan Bateman wrote:
> :
>
> Just to double check, are you 100% sure that its the "assert 
> Thread.holdsLock(this)" that is being being triggered? I ask because 
> this method method is only every called while holding the lock. I 
> wonder if instead you are seeing the "assert !result.isDone()" being 
> triggered. That is what JDK-7052549 is about.
Yuri - would you be able to test a patch for this to see if this resolves the issue you are seeing?

-Alan.


diff --git
a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
b/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
--- a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
+++ b/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.
+++ java
@@ -228,6 +228,7 @@
          @Override
          public void run() {
              long overlapped = 0L;
+            boolean pending = false;
              try {
                  begin();

@@ -241,6 +242,7 @@
                                       overlapped);
                      if (n == IOStatus.UNAVAILABLE) {
                          // I/O is pending
+                        pending = true;
                          return;
                      }
                      // acquired lock immediately @@ -250,10 +252,10 @@
              } catch (Throwable x) {
                  // lock failed or channel closed
                  removeFromFileLockTable(fli);
-                if (overlapped != 0L)
-                    ioCache.remove(overlapped);
                  result.setFailure(toIOException(x));
              } finally {
+                if (!pending && overlapped != 0L)
+                    ioCache.remove(overlapped);
                  end();
              }




More information about the nio-dev mailing list