diff --git a/config/PropertyNames.xml b/config/PropertyNames.xml index 7ad77d03259..4065b58e0e3 100644 --- a/config/PropertyNames.xml +++ b/config/PropertyNames.xml @@ -157,7 +157,6 @@ -
diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CollocatedRequestHandler.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CollocatedRequestHandler.java index 4d48b673ee3..13e6cbf62d8 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CollocatedRequestHandler.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CollocatedRequestHandler.java @@ -106,7 +106,6 @@ int invokeAsyncRequest(OutgoingAsyncBase outAsync, int batchRequestNum, boolean if (!sync || !_response - || _reference.getInstance().queueRequests() || _reference.getInvocationTimeout().compareTo(Duration.ZERO) > 0) { _adapter.getThreadPool() .dispatch( diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CommunicatorFlushBatch.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CommunicatorFlushBatch.java index c1308a52c67..ef84bff2a17 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CommunicatorFlushBatch.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/CommunicatorFlushBatch.java @@ -4,8 +4,6 @@ package com.zeroc.Ice; -import java.util.concurrent.Callable; - class CommunicatorFlushBatch extends InvocationFuture { public CommunicatorFlushBatch(Communicator communicator, Instance instance) { super(communicator, instance, "flushBatchRequests"); @@ -74,26 +72,6 @@ protected com.zeroc.Ice.Instrumentation.InvocationObserver getObserver() { con.getBatchRequestQueue().swap(flushBatch.getOs()); if (r == null) { flushBatch.sent(); - } else if (_instance.queueRequests()) { - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws RetryException { - boolean comp = false; - if (compressBatch == CompressBatch.Yes) { - comp = true; - } else if (compressBatch == CompressBatch.No) { - comp = false; - } else { - comp = r.compress; - } - con.sendAsyncRequest( - flushBatch, comp, false, r.batchRequestNum); - return null; - } - }); } else { boolean comp = false; if (compressBatch == CompressBatch.Yes) { diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectRequestHandler.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectRequestHandler.java index 73a8333c92b..14edd5cbbd3 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectRequestHandler.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectRequestHandler.java @@ -4,8 +4,6 @@ package com.zeroc.Ice; -import java.util.concurrent.Callable; - final class ConnectRequestHandler implements RequestHandler, Reference.GetConnectionCallback, RouterInfo.AddProxyCallback { @Override @@ -177,24 +175,6 @@ private boolean initialized() { } private void flushRequests() { - if (_reference.getInstance().queueRequests()) { - _reference - .getInstance() - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws Exception { - flushRequestsImpl(); - return null; - } - }); - } else { - flushRequestsImpl(); - } - } - - private void flushRequestsImpl() { synchronized (this) { assert (_connection != null && !_initialized); diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionFlushBatch.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionFlushBatch.java index 15a8851f624..2ccbd524179 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionFlushBatch.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionFlushBatch.java @@ -4,8 +4,6 @@ package com.zeroc.Ice; -import java.util.concurrent.Callable; - class ConnectionFlushBatch extends OutgoingAsyncBase { public ConnectionFlushBatch(ConnectionI con, Communicator communicator, Instance instance) { super(communicator, instance, "flushBatchRequests"); @@ -32,29 +30,6 @@ public void invoke(CompressBatch compressBatch) { if (sent()) { status |= AsyncStatus.InvokeSentCallback; } - } else if (_instance.queueRequests()) { - status = - _instance - .getQueueExecutor() - .execute( - new Callable() { - @Override - public Integer call() throws RetryException { - boolean comp = false; - if (compressBatch == CompressBatch.Yes) { - comp = true; - } else if (compressBatch == CompressBatch.No) { - comp = false; - } else { - comp = r.compress; - } - return _connection.sendAsyncRequest( - ConnectionFlushBatch.this, - comp, - false, - r.batchRequestNum); - } - }); } else { boolean comp = false; if (compressBatch == CompressBatch.Yes) { diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionI.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionI.java index 1cd22bf07b6..9cdc2ab98a2 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionI.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/ConnectionI.java @@ -6,7 +6,6 @@ import com.zeroc.Ice.Instrumentation.ConnectionState; -import java.util.concurrent.Callable; import java.util.concurrent.CompletionStage; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; @@ -126,25 +125,10 @@ public synchronized void destroy(int reason) { } @Override - public void abort() { - if (Thread.interrupted()) { - throw new OperationInterruptedException(); - } - - if (_instance.queueRequests()) { - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws LocalException { - abortImpl(); - return null; - } - }); - } else { - abortImpl(); - } + public synchronized void abort() { + setState( + StateClosed, + new ConnectionAbortedException("connection aborted by the application", true)); } @Override @@ -153,56 +137,35 @@ public void close() { throw new OperationInterruptedException(); } - if (_instance.queueRequests()) { - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws LocalException { - closeImpl(); - return null; - } - }); - } else { - closeImpl(); - } - } - - private synchronized void abortImpl() { - setState( - StateClosed, - new ConnectionAbortedException("connection aborted by the application", true)); - } - - private synchronized void closeImpl() { - if (_state < StateClosing) { - if (_asyncRequests.isEmpty()) { - doApplicationClose(); - } else { - _closeRequested = true; - // we don't wait forever for outstanding invocations to complete - scheduleCloseTimer(); + synchronized (this) { + if (_state < StateClosing) { + if (_asyncRequests.isEmpty()) { + doApplicationClose(); + } else { + _closeRequested = true; + // we don't wait forever for outstanding invocations to complete + scheduleCloseTimer(); + } } - } - // else nothing else to do, already closing or closed. + // else nothing else to do, already closing or closed. - // Wait until the connection has been closed. - while (_state < StateClosed) { - try { - wait(); - } catch (InterruptedException ex) { - throw new OperationInterruptedException(ex); + // Wait until the connection has been closed. + while (_state < StateClosed) { + try { + wait(); + } catch (InterruptedException ex) { + throw new OperationInterruptedException(ex); + } } - } - if (!(_exception instanceof ConnectionClosedException - || _exception instanceof CloseConnectionException - || _exception instanceof CommunicatorDestroyedException - || _exception instanceof ObjectAdapterDeactivatedException - || _exception instanceof ObjectAdapterDestroyedException)) { - assert (_exception != null); - throw _exception; + if (!(_exception instanceof ConnectionClosedException + || _exception instanceof CloseConnectionException + || _exception instanceof CommunicatorDestroyedException + || _exception instanceof ObjectAdapterDeactivatedException + || _exception instanceof ObjectAdapterDestroyedException)) { + assert (_exception != null); + throw _exception; + } } } @@ -872,7 +835,6 @@ protected void upcall( // Decrease dispatch count. // if (dispatchedCount > 0) { - boolean shutdown = false; boolean finished = false; synchronized (this) { @@ -885,18 +847,10 @@ protected void upcall( // in the closing state. // if (_state == StateClosing) { - if (_instance.queueRequests()) { - // - // We can't call initiateShutdown() from this thread in certain - // situations (such as in Android). - // - shutdown = true; - } else { - try { - initiateShutdown(); - } catch (LocalException ex) { - setState(StateClosed, ex); - } + try { + initiateShutdown(); + } catch (LocalException ex) { + setState(StateClosed, ex); } } else if (_state == StateFinished) { finished = true; @@ -904,19 +858,13 @@ protected void upcall( _observer.detach(); } } - if (!shutdown) { - notifyAll(); - } + notifyAll(); } } if (finished && _removeFromFactory != null) { _removeFromFactory.accept(this); } - - if (shutdown) { - queueShutdown(true); - } } } @@ -933,24 +881,10 @@ public void finished(ThreadPoolCurrent current, final boolean close) { assert _state == StateClosed; } - if (_instance.queueRequests()) { - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws LocalException { - finish(close); - return null; - } - }); - return; - } - // // If there are no callbacks to call, we don't call ioCompleted() since // we're not going to call code that will potentially block (this avoids - // promoting a new leader and unecessary thread creation, especially if + // promoting a new leader and unnecessary thread creation, especially if // this is called on shutdown). // if (_startCallback == null @@ -1033,24 +967,7 @@ public void finish(boolean close) { } if (_startCallback != null) { - if (_instance.queueRequests()) { - // - // The connectionStartFailed method might try to connect with another connector. - // - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws LocalException { - _startCallback.connectionStartFailed( - ConnectionI.this, _exception); - return null; - } - }); - } else { - _startCallback.connectionStartFailed(this, _exception); - } + _startCallback.connectionStartFailed(this, _exception); _startCallback = null; } @@ -1610,31 +1527,6 @@ private void initiateShutdown() { } } - private void queueShutdown(boolean notify) { - // - // Must be called without synchronization! - // - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws LocalException { - synchronized (ConnectionI.this) { - try { - initiateShutdown(); - } catch (LocalException ex) { - setState(StateClosed, ex); - } - if (notify) { - ConnectionI.this.notifyAll(); - } - } - return null; - } - }); - } - private boolean initialize(int operation) { int s = _transceiver.initialize(_readStream.getBuffer(), _writeStream.getBuffer()); if (s != SocketOperation.None) { @@ -2278,34 +2170,6 @@ private void dispatchAll( private void sendResponse(OutgoingResponse response, boolean isTwoWay, byte compress) { final OutputStream outputStream = response.outputStream; - - // We may be executing on the "main thread" (e.g., in Android together with a - // custom executor) and therefore we have to defer network calls to a separate - // thread. - final boolean queueResponse = isTwoWay && _instance.queueRequests(); - - if (queueResponse) { - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws LocalException { - sendResponseImpl(outputStream, isTwoWay, compress); - return null; - } - }); - } else { - // Can return true only when isTwoWay is false. - if (sendResponseImpl(outputStream, isTwoWay, compress)) { - queueShutdown(false); - } - } - } - - private boolean sendResponseImpl(OutputStream outputStream, boolean isTwoWay, byte compress) { - // Must be called without synchronization! - boolean shutdown = false; boolean finished = false; try { synchronized (this) { @@ -2342,17 +2206,7 @@ private boolean sendResponseImpl(OutputStream outputStream, boolean isTwoWay, by } if (_state == StateClosing && _upcallCount == 0) { - // - // We may be executing on the "main thread" (e.g., in Android together with - // a custom - // executor) and therefore we have to defer network calls to a separate - // thread. - // - if (!isTwoWay && _instance.queueRequests()) { - shutdown = true; - } else { - initiateShutdown(); - } + initiateShutdown(); } } catch (LocalException ex) { setState(StateClosed, ex); @@ -2363,7 +2217,6 @@ private boolean sendResponseImpl(OutputStream outputStream, boolean isTwoWay, by _removeFromFactory.accept(this); } } - return shutdown; } private void dispatchException(LocalException ex, int requestCount) { diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FixedReference.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FixedReference.java index c96f64c48ed..e3e1bc55375 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FixedReference.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FixedReference.java @@ -219,11 +219,7 @@ RequestHandler getRequestHandler() { defaultsAndOverrides.overrideCompress.isPresent() ? defaultsAndOverrides.overrideCompress.get() : getCompress().orElse(false); - RequestHandler handler = new ConnectionRequestHandler(this, _fixedConnection, compress); - if (getInstance().queueRequests()) { - handler = new QueueRequestHandler(getInstance(), handler); - } - return handler; + return new ConnectionRequestHandler(this, _fixedConnection, compress); } @Override diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java index 63906e3607a..d43ddefc540 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java @@ -674,17 +674,6 @@ public Class getConcreteClass(String className) throws LinkageError { return null; } - public boolean queueRequests() { - return _queueExecutorService != null; - } - - public synchronized QueueExecutorService getQueueExecutor() { - if (_state == StateDestroyed) { - throw new CommunicatorDestroyedException(); - } - return _queueExecutorService; - } - // // Only for use by com.zeroc.Ice.Communicator // @@ -916,19 +905,7 @@ public void initialize(Communicator communicator, InitializationData initData) { _retryIntervals[i] = v > 0 ? v : 0; } } - - // If Ice.ThreadInterruptSafe is set all IO is done on the background thread. - if (properties.getIcePropertyAsInt("Ice.ThreadInterruptSafe") > 0) { - _queueExecutor = - new QueueExecutor( - properties, Util.createThreadName(properties, "Ice.BackgroundIO")); - _queueExecutorService = new QueueExecutorService(_queueExecutor); - - // Caching message buffers is not supported with background IO. - _cacheMessageBuffers = 0; - } else { - _cacheMessageBuffers = properties.getIcePropertyAsInt("Ice.CacheMessageBuffers"); - } + _cacheMessageBuffers = properties.getIcePropertyAsInt("Ice.CacheMessageBuffers"); } catch (Exception ex) { destroy(false); throw ex; @@ -1210,9 +1187,6 @@ void destroy(boolean interruptible) { if (_endpointHostResolver != null) { _endpointHostResolver.joinWithThread(); } - if (_queueExecutor != null) { - _queueExecutor.destroy(); - } if (_timer != null) { while (!_timer.isTerminated()) { // A very long time. @@ -1290,9 +1264,6 @@ void destroy(boolean interruptible) { _adminAdapter = null; _adminFacets.clear(); - _queueExecutor = null; - _queueExecutorService = null; - _sliceTypeIdToClassMap.clear(); _state = StateDestroyed; @@ -1399,9 +1370,6 @@ private void updateThreadObservers() { if (_timer != null) { _timer.updateObserver(_initData.observer); } - if (_queueExecutor != null) { - _queueExecutor.updateObserver(_initData.observer); - } } catch (CommunicatorDestroyedException ex) { } } @@ -1570,8 +1538,6 @@ private ConnectionOptions readConnectionOptions(String propertyPrefix) { private String[] _packages; private static boolean _oneOffDone = false; - private QueueExecutorService _queueExecutorService; - private QueueExecutor _queueExecutor; private com.zeroc.Ice.SSL.SSLEngine _sslEngine; private Map _builtInModulePackagePrefixes = diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/OutgoingConnectionFactory.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/OutgoingConnectionFactory.java index ee145e22bd9..71f5c03657d 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/OutgoingConnectionFactory.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/OutgoingConnectionFactory.java @@ -5,7 +5,6 @@ package com.zeroc.Ice; import java.util.Arrays; -import java.util.concurrent.Callable; final class OutgoingConnectionFactory { // @@ -133,25 +132,7 @@ public void create( } final ConnectCallback cb = new ConnectCallback(this, endpoints, hasMore, callback, selType); - // - // Calling cb.getConnectors() can eventually result in a call to connect() on a socket, - // which is - // not allowed while in Android's main thread (with an executor installed). - // - if (_instance.queueRequests()) { - _instance - .getQueueExecutor() - .executeNoThrow( - new Callable() { - @Override - public Void call() throws Exception { - cb.getConnectors(); - return null; - } - }); - } else { - cb.getConnectors(); - } + cb.getConnectors(); } public void setRouterInfo(RouterInfo routerInfo) { diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java index 3e710f82eb3..348b8e49abc 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java @@ -162,8 +162,7 @@ final class PropertyNames new Property("Warn.Dispatch", false, "1", false, null), new Property("Warn.Endpoints", false, "1", false, null), new Property("Warn.UnusedProperties", false, "0", false, null), - new Property("CacheMessageBuffers", false, "2", false, null), - new Property("ThreadInterruptSafe", false, "", false, null) + new Property("CacheMessageBuffers", false, "2", false, null) }); public static final PropertyArray IceMXProps = new PropertyArray( diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/QueueExecutorService.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/QueueExecutorService.java deleted file mode 100644 index d0588c3dc6d..00000000000 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/QueueExecutorService.java +++ /dev/null @@ -1,82 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -package com.zeroc.Ice; - -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.RejectedExecutionException; - -final class QueueExecutorService { - QueueExecutorService(ExecutorService executor) { - _executor = executor; - _thread = - executeNoThrow( - new Callable() { - @Override - public Thread call() { - return Thread.currentThread(); - } - }); - } - - public T executeNoThrow(Callable callable) { - try { - return execute(callable); - } catch (RetryException ex) { - assert (false); - return null; - } - } - - public T execute(Callable callable) throws RetryException { - if (_thread == Thread.currentThread()) { - try { - return callable.call(); - } catch (RuntimeException ex) { - throw ex; - } catch (Exception ex) { - // RetryException is the only checked exception that - // can be raised by Ice internals. - assert (ex instanceof RetryException); - throw (RetryException) ex; - } - } - - boolean interrupted = false; - try { - Future future = _executor.submit(callable); - while (true) { - try { - T value = future.get(); - return value; - } catch (InterruptedException ex) { - interrupted = true; - } - } - } catch (RejectedExecutionException e) { - throw new CommunicatorDestroyedException(); - } catch (ExecutionException e) { - try { - throw e.getCause().fillInStackTrace(); - } catch (RuntimeException ex) { - throw ex; - } catch (Throwable ex) { - // RetryException is the only checked exception that - // can be raised by Ice internals. - assert (ex instanceof RetryException); - throw (RetryException) ex; - } - } finally { - if (interrupted) { - Thread.currentThread().interrupt(); - } - } - } - - final ExecutorService _executor; - final Thread _thread; -} diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/QueueRequestHandler.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/QueueRequestHandler.java deleted file mode 100644 index 01a46ddd9ea..00000000000 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/QueueRequestHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -package com.zeroc.Ice; - -import java.util.concurrent.Callable; - -final class QueueRequestHandler implements RequestHandler { - public QueueRequestHandler(Instance instance, RequestHandler delegate) { - _executor = instance.getQueueExecutor(); - assert (delegate != null); - _delegate = delegate; - } - - @Override - public int sendAsyncRequest(final ProxyOutgoingAsyncBase out) throws RetryException { - return _executor.execute( - new Callable() { - @Override - public Integer call() throws RetryException { - return _delegate.sendAsyncRequest(out); - } - }); - } - - @Override - public void asyncRequestCanceled(final OutgoingAsyncBase outAsync, final LocalException ex) { - _executor.executeNoThrow( - new Callable() { - @Override - public Void call() { - _delegate.asyncRequestCanceled(outAsync, ex); - return null; - } - }); - } - - @Override - public ConnectionI getConnection() { - return _delegate.getConnection(); - } - - private final RequestHandler _delegate; - private final QueueExecutorService _executor; -} diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/RoutableReference.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/RoutableReference.java index c8b7955c329..e50a82c55b2 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/RoutableReference.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/RoutableReference.java @@ -388,17 +388,7 @@ RequestHandler getRequestHandler() { } var handler = new ConnectRequestHandler(this); - if (instance.queueRequests()) { - final ConnectRequestHandler h = handler; - instance.getQueueExecutor() - .executeNoThrow( - () -> { - getConnection(h); - return null; - }); - } else { - getConnection(handler); - } + getConnection(handler); return handler; } diff --git a/java/test/src/main/java/test/Ice/interrupt/AllTests.java b/java/test/src/main/java/test/Ice/interrupt/AllTests.java index 689df34ffcb..6954a30aef8 100644 --- a/java/test/src/main/java/test/Ice/interrupt/AllTests.java +++ b/java/test/src/main/java/test/Ice/interrupt/AllTests.java @@ -78,19 +78,7 @@ public static void allTests(test.TestHelper helper) throws InterruptedException out.flush(); { final Thread mainThread = Thread.currentThread(); - mainThread.interrupt(); - try { - // Synchronous invocations are interruption points. If the - // interrupt flag is set at the start of the operation - // OperationInterruptedException must be thrown. - p.op(); - test(false); - } catch (com.zeroc.Ice.OperationInterruptedException ex) { - // Expected - test(!mainThread.isInterrupted()); - } - // Same test with the AMI API. try { // // We call sleep here to add a small delay. Otherwise there's a chance that the @@ -120,25 +108,6 @@ public static void allTests(test.TestHelper helper) throws InterruptedException cb.check(); ExecutorService executor = java.util.concurrent.Executors.newFixedThreadPool(1); - executor.submit( - () -> { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - test(false); - } - mainThread.interrupt(); - }); - try { - test(!mainThread.isInterrupted()); - p.sleep(2000); - test(false); - } catch (com.zeroc.Ice.OperationInterruptedException ex) { - // Expected - } catch (test.Ice.interrupt.Test.InterruptedException e) { - test(false); - } - executor.submit( () -> { try { @@ -158,25 +127,6 @@ public static void allTests(test.TestHelper helper) throws InterruptedException // Expected } - executor.submit( - () -> { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - test(false); - } - mainThread.interrupt(); - }); - try { - test(!mainThread.isInterrupted()); - p.opIdempotent(); - test(false); - } catch (com.zeroc.Ice.OperationInterruptedException ex) { - // Expected - } catch (com.zeroc.Ice.ConnectionLostException ex) { - test(false); - } - // Test waitForSent is an interruption point. try { CompletableFuture r = p.opAsync(); diff --git a/java/test/src/main/java/test/Ice/interrupt/Client.java b/java/test/src/main/java/test/Ice/interrupt/Client.java index c266f544e97..92acdac24ac 100644 --- a/java/test/src/main/java/test/Ice/interrupt/Client.java +++ b/java/test/src/main/java/test/Ice/interrupt/Client.java @@ -9,11 +9,6 @@ public void run(String[] args) { com.zeroc.Ice.Properties properties = createTestProperties(args); properties.setProperty("Ice.Package.Test", "test.Ice.interrupt"); // - // We need to enable the ThreadInterruptSafe property so that Ice is - // interrupt safe for this test. - // - properties.setProperty("Ice.ThreadInterruptSafe", "1"); - // // We need to send messages large enough to cause the transport // buffers to fill up. // diff --git a/java/test/src/main/java/test/Ice/interrupt/Collocated.java b/java/test/src/main/java/test/Ice/interrupt/Collocated.java index 2c19684e3ad..e83452f088b 100644 --- a/java/test/src/main/java/test/Ice/interrupt/Collocated.java +++ b/java/test/src/main/java/test/Ice/interrupt/Collocated.java @@ -9,11 +9,6 @@ public void run(String[] args) { com.zeroc.Ice.Properties properties = createTestProperties(args); properties.setProperty("Ice.Package.Test", "test.Ice.interrupt"); // - // We need to enable the ThreadInterruptSafe property so that Ice is - // interrupt safe for this test. - // - properties.setProperty("Ice.ThreadInterruptSafe", "1"); - // // We need to send messages large enough to cause the transport // buffers to fill up. // diff --git a/java/test/src/main/java/test/Ice/interrupt/Server.java b/java/test/src/main/java/test/Ice/interrupt/Server.java index c3d0a494773..a4166564fc9 100644 --- a/java/test/src/main/java/test/Ice/interrupt/Server.java +++ b/java/test/src/main/java/test/Ice/interrupt/Server.java @@ -9,11 +9,6 @@ public void run(String[] args) { com.zeroc.Ice.Properties properties = createTestProperties(args); properties.setProperty("Ice.Package.Test", "test.Ice.interrupt"); // - // We need to enable the ThreadInterruptSafe property so that Ice is - // interrupt safe for this test. - // - properties.setProperty("Ice.ThreadInterruptSafe", "1"); - // // We need to send messages large enough to cause the transport // buffers to fill up. // diff --git a/java/test/src/main/java/test/Ice/metrics/AllTests.java b/java/test/src/main/java/test/Ice/metrics/AllTests.java index 58c63af2740..6bf67adb7f9 100644 --- a/java/test/src/main/java/test/Ice/metrics/AllTests.java +++ b/java/test/src/main/java/test/Ice/metrics/AllTests.java @@ -334,12 +334,6 @@ static MetricsPrx allTests(test.TestHelper helper, CommunicatorObserverI obsv) boolean collocated = metrics.ice_getConnection() == null; int threadCount = 4; - if (collocated - && communicator.getProperties().getIcePropertyAsInt("Ice.ThreadInterruptSafe") - > 0) { - threadCount = 6; - } - out.print("testing metrics admin facet checkedCast... "); out.flush(); com.zeroc.Ice.ObjectPrx admin = communicator.getAdmin(); diff --git a/java/test/src/main/java/test/Ice/metrics/Collocated.java b/java/test/src/main/java/test/Ice/metrics/Collocated.java index 4a70ca7beaf..9a04d13e2c4 100644 --- a/java/test/src/main/java/test/Ice/metrics/Collocated.java +++ b/java/test/src/main/java/test/Ice/metrics/Collocated.java @@ -11,12 +11,6 @@ public void run(String[] args) { CommunicatorObserverI observer = new CommunicatorObserverI(); com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData(); initData.properties = createTestProperties(args); - if (initData.properties.getIcePropertyAsInt("Ice.ThreadInterruptSafe") > 0) { - // With background IO, collocated invocations are - // dispatched on the server thread pool. This test needs - // at least 3 threads in the server thread pool to work. - initData.properties.setProperty("Ice.ThreadPool.Server.Size", "3"); - } initData.properties.setProperty("Ice.Package.Test", "test.Ice.metrics"); initData.properties.setProperty("Ice.Admin.Endpoints", "tcp"); initData.properties.setProperty("Ice.Admin.InstanceName", "client"); diff --git a/java/test/src/main/java/test/Ice/operations/Collocated.java b/java/test/src/main/java/test/Ice/operations/Collocated.java index 4a3c1f98512..22dff903d5e 100644 --- a/java/test/src/main/java/test/Ice/operations/Collocated.java +++ b/java/test/src/main/java/test/Ice/operations/Collocated.java @@ -9,16 +9,13 @@ public class Collocated extends test.TestHelper { public void run(String[] args) { com.zeroc.Ice.Properties properties = createTestProperties(args); - if (properties.getIcePropertyAsInt("Ice.ThreadInterruptSafe") > 0 || isAndroid()) { - properties.setProperty("Ice.ThreadPool.Server.Size", "2"); - } properties.setProperty("Ice.Package.Test", "test.Ice.operations"); properties.setProperty("Ice.BatchAutoFlushSize", "100"); // // Its possible to have batch oneway requests dispatched // after the adapter is deactivated due to thread - // scheduling so we supress this warning. + // scheduling so we suppress this warning. // properties.setProperty("Ice.Warn.Dispatch", "0"); try (com.zeroc.Ice.Communicator communicator = initialize(properties)) {