Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ protected void waitForLogout() {
Thread.sleep(100L);
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
Thread.currentThread().interrupt();
}
final long elapsed = System.currentTimeMillis() - start;
Iterator<Session> sessionItr = loggedOnSessions.iterator();
Expand Down Expand Up @@ -375,6 +376,7 @@ public void run() {
try {
delegate.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}

Expand Down Expand Up @@ -449,9 +451,10 @@ public static void closeManagedSessionsAndDispose(IoService ioService, boolean a
completed = closeFuture.await(1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
if (!completed) {
logger.warn("Could not close IoSession {}", ioSession);
} finally {
if (!completed) {
logger.warn("Could not close IoSession {}", ioSession);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void onMessage(Session quickfixSession, Message message) {
queueTracker.put(new SessionMessageEvent(quickfixSession, message));
} catch (InterruptedException e) {
isStopped = true;
throw new RuntimeException(e);
Thread.currentThread().interrupt();
}
}

Expand Down Expand Up @@ -196,7 +196,8 @@ public void stopHandlingMessages(boolean join) {
try {
messageProcessingThread.join();
} catch (InterruptedException e) {
sessionConnector.log.error("{} interrupted.", MESSAGE_PROCESSOR_THREAD_NAME);
sessionConnector.log.warn("{} interrupted.", MESSAGE_PROCESSOR_THREAD_NAME);
Thread.currentThread().interrupt();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public void enqueue(Message message) {
queueTracker.put(message);
} catch (final InterruptedException e) {
quickfixSession.getLog().onErrorEvent(e.toString());
Thread.currentThread().interrupt();
}
}

Expand All @@ -227,6 +228,7 @@ void doRun() {
LogUtil.logThrowable(quickfixSession.getSessionID(),
"Message dispatcher interrupted", e);
stopping = true;
Thread.currentThread().interrupt();
} catch (final Throwable e) {
LogUtil.logThrowable(quickfixSession.getSessionID(),
"Error during message processing", e);
Expand Down
2 changes: 2 additions & 0 deletions quickfixj-core/src/test/java/quickfix/MultiAcceptorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public void waitForLogon() {
try {
logonLatch.await(20, TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
fail(e.getMessage());
}
}
Expand All @@ -220,6 +221,7 @@ public synchronized void waitForMessages() {
fail("Timed out waiting for message");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
fail(e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public void waitForLogon() {
try {
logonLatch.await(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
fail(e.getMessage());
}
}
Expand All @@ -148,6 +149,7 @@ public synchronized void waitForMessages() {
fail("Timed out waiting for message");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
fail(e.getMessage());
}
}
Expand Down Expand Up @@ -225,7 +227,7 @@ public void run() {
try {
Thread.sleep(12000);
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
threadIds = bean.findDeadlockedThreads();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void fromApp(Message message, SessionID sessionId) throws FieldNotFound,
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
System.out.println("Server: message processing end");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void fromApp(Message message, SessionID sessionId) throws FieldNotFound,
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
System.out.println("Server: message processing end");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void cleanup() {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
// ignored
Thread.currentThread().interrupt();
}
}
}
Expand Down Expand Up @@ -373,7 +373,7 @@ private static void assertQFJMessageProcessorThreads(int expected) {
try {
Thread.sleep(100);
} catch (InterruptedException ex) {
// ignored
Thread.currentThread().interrupt();
}
dumpAllThreads = bean.dumpAllThreads(false, false);
qfjMPThreads = getMessageProcessorThreads(dumpAllThreads);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public void run() {
shutdownLatch.await();
} catch (InterruptedException e1) {
try {
Thread.currentThread().interrupt();
acceptor.stop(true);
} catch (RuntimeException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void cleanup() {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
java.util.logging.Logger.getLogger(SSLCertificateTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void run(TestResult result, TestConnection connection) {
try {
Thread.sleep(reconnectDelay);
} catch (InterruptedException e1) {
e1.printStackTrace();
Thread.currentThread().interrupt();
}
}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ private TestIoHandler getIoHandler(int clientId) {

public void tearDown() {
for (TestIoHandler testIoHandler : ioHandlers.values()) {
CloseFuture closeFuture = testIoHandler.getSession().closeNow();
closeFuture.awaitUninterruptibly();
IoSession session = testIoHandler.getSession();
if (session != null) {
CloseFuture closeFuture = session.closeNow();
closeFuture.awaitUninterruptibly();
}
}
ioHandlers.clear();
}
Expand Down Expand Up @@ -165,6 +168,7 @@ public IoSession getSession() {
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
return session;
Expand Down