Skip to content

Commit

Permalink
JGRP-2835 Do not log warn during normal shutdown.
Browse files Browse the repository at this point in the history
Fix interrupt handling.
  • Loading branch information
pferraro committed Sep 13, 2024
1 parent 43db691 commit d6777b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/org/jgroups/protocols/TransferQueueBundler.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public synchronized void stop() {
if(tmp != null) {
tmp.interrupt();
if(tmp.isAlive()) {
try {tmp.join(500);} catch(InterruptedException e) {}
try {
tmp.join(500);
}
catch(InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
drain();
Expand All @@ -107,7 +112,7 @@ public void send(Message msg) throws Exception {
}

public void run() {
while(running) {
while(!Thread.currentThread().isInterrupted()) {
Message msg=null;
try {
if((msg=queue.take()) == null)
Expand All @@ -127,6 +132,9 @@ public void run() {
num_sends_because_no_msgs++;
}
}
catch(InterruptedException e) {
Thread.currentThread().interrupt();
}
catch(Throwable t) {
log.trace("%s: failed sending message: %s", transport.addr(), t);
}
Expand Down
13 changes: 11 additions & 2 deletions src/org/jgroups/protocols/TransferQueueBundler2.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ public synchronized void stop() {
if(tmp != null) {
tmp.interrupt();
if(tmp.isAlive()) {
try {tmp.join(500);} catch(InterruptedException e) {}
try {
tmp.join(500);
}
catch(InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
drain();
Expand All @@ -156,7 +161,7 @@ public void send(Message msg) throws Exception {
}

public void run() {
while(running) {
while(!Thread.currentThread().isInterrupted()) {
Message msg=null;
try {
if((msg=queue.take()) == null)
Expand All @@ -181,7 +186,11 @@ public void run() {
sendBundledMessages();
}
}
catch(InterruptedException e) {
Thread.currentThread().interrupt();
}
catch(Throwable t) {
log.warn("%s: failed sending message: %s", transport.addr(), t);
}
}
}
Expand Down

0 comments on commit d6777b1

Please sign in to comment.