ARTEMIS-908: Hold connection lock when issuing credits
This commit is contained in:
parent
4dc9751874
commit
f2f3552067
|
@ -433,11 +433,13 @@ public class AMQPSessionCallback implements SessionCallback {
|
||||||
store.checkMemory(new Runnable() {
|
store.checkMemory(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
synchronized (connection.getLock()) {
|
||||||
if (receiver.getRemoteCredit() < threshold) {
|
if (receiver.getRemoteCredit() < threshold) {
|
||||||
receiver.flow(credits);
|
receiver.flow(credits);
|
||||||
connection.flush();
|
connection.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
Loading…
Reference in New Issue