SteNicholas opened a new pull request, #2450:
URL: https://github.com/apache/celeborn/pull/2450

   ### What changes were proposed in this pull request?
   
   `HttpServer` set idle timeout to 0 in order to avoid Jetty's acceptor thread 
shrink for stopping.
   
   ### Why are the changes needed?
   
   When the Jetty's acceptor thread shrinks before the main thread sends a 
signal to the thread, the issue `java.io.IOException: No such file or 
directory` could happen.
   
   Jetty's acceptor thread waits for a new connection request and blocked by 
accept(this.fd, newfd, isaa) in 
[sun.nio.ch.ServerSocketChannelImpl#accept](http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java#l241).
   
   When org.eclipse.jetty.server.Server.doStop is called in the main thread, 
the thread reaches [this 
code](http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java#l280).
   
   The server socket descriptor will be closed by nd.preClose in the main 
thread.
   Then, accept() in acceptor thread throws an Exception due to "Bad file 
descriptor" in case of macOS.
   After the exception is thrown, the acceptor thread will continue to [fetch a 
task](https://github.com/eclipse/jetty.project/blob/jetty-9.4.18.v20190429/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java#L783).
   If the thread obtain the SHRINK task 
[here](https://github.com/eclipse/jetty.project/blob/jetty-9.4.18.v20190429/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java#L854),
 the thread will be shrink.
   If, the acceptor thread finishes before `NativeThread.signal` is called in 
the main thread, this issue happens.
   
   Backport https://github.com/apache/spark/pull/28437.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to