We've hit a problem a couple of times recently where our servers have become permanently blocked when trying to publish to STAN.
Specifically, publishes are hanging when trying to put in the BlockingQueue which is utilised to control the number of outstanding acks:
StreamingConnectionImpl.java:348
// Use the buffered channel to control the number of outstanding acks.
try {
pac.put(PubAck.getDefaultInstance()); // <<--- hang
} catch (InterruptedException e) {
// TODO: Reevaluate this.
// Eat this because you can't really do anything with it
}
If we tear down the STAN connection by completely disconnecting and reconnecting from the server, these threads still remain blocked in the publish on the now closed connection.
I'm thinking perhaps this put() should be an offer() with a timeout, allowing publishes to optionally fail back to the caller (via a thrown exception) if too many are in flight.
Alternatively, or perhaps also, when a streaming connection is torn down, perhaps it should empty the BlockingQueue so that any publishes hanging on the put/offer would at least progress.
We've hit a problem a couple of times recently where our servers have become permanently blocked when trying to publish to STAN.
Specifically, publishes are hanging when trying to put in the BlockingQueue which is utilised to control the number of outstanding acks:
StreamingConnectionImpl.java:348
If we tear down the STAN connection by completely disconnecting and reconnecting from the server, these threads still remain blocked in the publish on the now closed connection.
I'm thinking perhaps this
put()should be anoffer()with a timeout, allowing publishes to optionally fail back to the caller (via a thrown exception) if too many are in flight.Alternatively, or perhaps also, when a streaming connection is torn down, perhaps it should empty the BlockingQueue so that any publishes hanging on the put/offer would at least progress.