-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Labels
status: duplicateA duplicate of another issueA duplicate of another issue
Description
In org.springframework.boot.loader.data.RandomAccessDataFile
, when read file, it will call Semaphore.acquire
. When the current thread state is interrupted
, it will throw InterruptedException
. The thread will failed to read file.
// java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(int arg
public final void acquireSharedInterruptibly(int arg)
throws InterruptedException {
if (Thread.interrupted())
throw new InterruptedException();
if (tryAcquireShared(arg) < 0)
doAcquireSharedInterruptibly(arg);
}
Consider the following case:
- A executor submit a Runnable task, then call
FutureTask.cancel
to cancel it. - The Runnable task thread state is marked as interrupted, but it will continue running.
- The Runnable task thread try to load class
A
, the spring boot classloader will useRandomAccessDataFile
to read A.class file from fat jar. ButRandomAccessDataFile
will throwIOException
, because the current thread state is interrupted. - The clsssloader thow
NoClassDefFoundError
Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issue