Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Request for consideration

We have someone doing some testing that is having a problem with the Java client. The situation is this, the server is designed to queue up to a set maximum of messages. If a publisher tries to publish a message while this maximum is filled, the server closes the connection. The testcase gets to this point, and when it receives an Exception from the publish it tries to reconnect to the server. Sometimes this reconnection fails with "Client is currently disconnecting (32102)".
It does eventually clear up the connection and reallow a new connection, but this can take a while, up to the KeepAliveInterval. What is happening is that in CommsSender.stop:

if (!Thread.currentThread().equals(sendThread)) {
try {
// first notify get routine to finish
clientState.notifyQueueLock();
// Wait for the thread to finish.
sendThread.join();
}
catch (InterruptedException ex) {
}
}

It is the sendThread.join() that is taking the time. Is there any reason you can't add a sendThread.interrupt(); before the join to interrupt the wait?

Marc L. Cohen
MessageSight Test/Development
Internet:mlcohen@xxxxxxxxxx
also at:teddybbear@xxxxxxx
(512) 286-5744 (T/L 363-5744)
FAX (512) 973-4293


Back to the top