8000 Merge pull request #55 from rabbitmq/rabbitmq-java-client-52 · jamesHaut/rabbitmq-java-client@c2df18f · GitHub
[go: up one dir, main page]

Skip to content

Commit c2df18f

Browse files
Merge pull request rabbitmq#55 from rabbitmq/rabbitmq-java-client-52
More sensible handling of InterruptedExceptions
2 parents 6d611d7 + b29a9c9 commit c2df18f

File tree

5 files changed

+8
-6
lines changed
  • utility
  • 5 files changed

    +8
    -6
    lines changed

    src/com/rabbitmq/client/impl/AMQChannel.java

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -58,7 +58,7 @@ public abstract class AMQChannel extends ShutdownNotifierComponent {
    5858
    private RpcContinuation _activeRpc = null;
    5959

    6060
    /** Whether transmission of content-bearing methods should be blocked */
    61-
    public boolean _blockContent = false;
    61+
    public volatile boolean _blockContent = false;
    6262

    6363
    /**
    6464
    * Construct a channel on the given connection, with the given channel number.

    src/com/rabbitmq/client/impl/AMQConnection.java

    Lines changed: 3 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -682,7 +682,9 @@ public SocketCloseWait(ShutdownSignalException sse) {
    682682

    683683
    public void run() {
    684684
    try {
    685-
    _appContinuation.uninterruptibleGet();
    685+
    _appContinuation.get();
    686+
    } catch (InterruptedException e) {
    687+
    Thread.currentThread().interrupt();
    686688
    } finally {
    687689
    _running = false;
    688690
    _channel0.notifyOutstandingRpc(cause);

    src/com/rabbitmq/client/impl/WorkPool.java

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -196,7 +196,7 @@ public boolean addWorkItem(K key, W item) {
    196196
    try {
    197197
    queue.put(item);
    198198
    } catch (InterruptedException e) {
    199-
    // ok
    199+
    Thread.currentThread().interrupt();
    200200
    }
    201201

    202202
    synchronized (this) {

    src/com/rabbitmq/tools/Tracer.java

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -216,8 +216,8 @@ public void run() {
    216216
    }
    217217
    }
    218218

    219-
    private void waitAndLogException(BlockingCell<Exception> bc) {
    220-
    reportAndLogNonNullException(bc.uninterruptibleGet());
    219+
    private void waitAndLogException(BlockingCell<Exception> bc) throws InterruptedException {
    220+
    reportAndLogNonNullException(bc.get());
    221221
    }
    222222

    223223
    private void reportAndLogNonNullException(Exception e) {

    src/com/rabbitmq/utility/SingleShotLinearTimer.java

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -80,7 +80,7 @@ public void run() {
    8080
    wait(_runTime - now);
    8181
    }
    8282
    } catch (InterruptedException e) {
    83-
    // Don't care
    83+
    Thread.currentThread().interrupt();
    8484
    }
    8585
    }
    8686

    0 commit comments

    Comments
     (0)
    0