diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java index 5f80f325367a..2e7ed1d5f131 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java @@ -75,8 +75,7 @@ public ManagedSelector(SelectorManager selectorManager, int id) _id = id; SelectorProducer producer = new SelectorProducer(); Executor executor = selectorManager.getExecutor(); - Scheduler scheduler = selectorManager.getScheduler(); - _strategy = new EatWhatYouKill(producer,executor,_selectorManager.getBean(ReservedThreadExecutor.class),scheduler); + _strategy = new EatWhatYouKill(producer,executor,_selectorManager.getBean(ReservedThreadExecutor.class)); addBean(_strategy,true); setStopTimeout(5000); } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentStack.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentStack.java deleted file mode 100644 index 9d185bce645b..000000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentStack.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util; - -import java.util.concurrent.atomic.AtomicReference; - -/** - *
Nonblocking stack using variation of Treiber's algorithm - * that allows for reduced garbage.
- */ -public class ConcurrentStack -{ - private final NodeStackA strategy where the thread that produces will run the resulting task if it @@ -78,8 +75,6 @@ private enum State { IDLE, PRODUCING, REPRODUCING } private final Producer _producer; private final Executor _executor; private final ReservedThreadExecutor _producers; - private final Scheduler _scheduler; - private final long _nonBlockingTaskTimeout = Long.getLong("org.eclipse.jetty.nonBlockingTaskTimeout", 2000); private State _state = State.IDLE; public EatWhatYouKill(Producer producer, Executor executor) @@ -93,16 +88,10 @@ public EatWhatYouKill(Producer producer, Executor executor, int maxReserved) } public EatWhatYouKill(Producer producer, Executor executor, ReservedThreadExecutor producers) - { - this(producer, executor, producers, null); - } - - public EatWhatYouKill(Producer producer, Executor executor, ReservedThreadExecutor producers, Scheduler scheduler) { _producer = producer; _executor = executor; _producers = producers; - _scheduler = scheduler; addBean(_producer); if (LOG.isDebugEnabled()) LOG.debug("{} created", this); @@ -255,7 +244,7 @@ public boolean doProduce() try { if (consume) - runTask(task); + task.run(); else _executor.execute(task); } @@ -284,33 +273,6 @@ public boolean doProduce() return producing; } - protected void runTask(Runnable task) - { - Scheduler.Task scheduled = null; - if (Invocable.getInvocationType(task) == InvocationType.NON_BLOCKING && _scheduler != null && _nonBlockingTaskTimeout > 0) - { - scheduled = _scheduler.schedule(() -> - { - LOG.warn("Non-blocking task {} is taking more than {} ms", task, _nonBlockingTaskTimeout); - if (_executor instanceof QueuedThreadPool) - { - QueuedThreadPool threadPool = (QueuedThreadPool)_executor; - threadPool.setDetailedDump(true); - LOG.warn("Non-blocking task {} - executor dump{}{}", System.lineSeparator(), threadPool.dump()); - } - }, _nonBlockingTaskTimeout, TimeUnit.MILLISECONDS); - } - try - { - task.run(); - } - finally - { - if (scheduled != null) - scheduled.cancel(); - } - } - @ManagedAttribute(value = "number of non blocking tasks consumed", readonly = true) public long getNonBlockingTasksConsumed() {