sarutak commented on a change in pull request #28585:
URL: https://github.com/apache/spark/pull/28585#discussion_r427716093
##########
File path: core/src/main/scala/org/apache/spark/ui/JettyUtils.scala
##########
@@ -500,7 +501,11 @@ private[spark] case class ServerInfo(
threadPool match {
case pool: QueuedThreadPool =>
// Workaround for SPARK-30385 to avoid Jetty's acceptor thread shrink.
- pool.setIdleTimeout(0)
+ // As of Jetty 9.4.21, the implementation of
+ // QueuedThreadPoolExecutor#setIdleTimeout is changed and
IllegalStateException
+ // will be thrown if we try to set idle timeout after the server has
started.
+ // But this workaround works for Jetty 9.4.28 by ignoring the
exception.
+ Try(pool.setIdleTimeout(0))
Review comment:
I noticed that as of Jetty 9.4.21, the implementation of
`QueuedThreadPool`.
When `QueuedThreadPool#setIdleTimeout` is called,
`QueuedThreadPool#_idleTimeout` is set to the new timeout as well as
[`ReservedThreadExecutor#_idleTimeout`](https://github.com/eclipse/jetty.project/blob/jetty-9.4.28.v20200408/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java#L312).
If `ReservedThreadExecutor#_idleTImeout` is tried to be set after Jetty has
started, [`IllegalStateException` will be
thrown](https://github.com/eclipse/jetty.project/blob/jetty-9.4.28.v20200408/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java#L149).
But `QueuedThreadPool#_idleTimeout` will be set so this workaround will
still work by ignoring the exception.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]