-
Notifications
You must be signed in to change notification settings - Fork 100
When setting linkcredit to 2 or higher, I cannot consume a large number of big data packets in the queue #191
Comments
Which broker are you using? It looks to me like the first message is received, an updated flow control is sent, then the broker doesn't send any additional messages and eventually closes the connection. The only oddity I see from this libraries side is that the |
I'm using RabbitMQ v3.7.8 2019/11/26 09:15:24 Sending... |
* Prevents unbounded buffer growth when more than one frame is read into the buffer. * Change buffer to grow by 2x rather than 512 bytes. Updates #191
* Prevents unbounded buffer growth when more than one frame is read into the buffer. * Change buffer to grow by 2x rather than 512 bytes. Updates #191
I was able to reproduce this locally. From what I observed it isn't that the broker isn't trying to send messages, but that the receive buffer was being grown without bound due to the combination of the way AMQP frames are read into the buffer and multiple frames being received in a single read. This is additionally slowed since the buffer was being grown only 512 bytes at a time. Presumably the combination of the near constant reallocation and the slow buffer growth stalls the connection to the point that it times out. I've corrected these issues in #194, which has been tagged as v0.12.5. Would you mind verifying that this corrects the problem for you as well? Thank you for reporting this issue! |
it works fine ,thanks |
When setting linkcredit to 2 or higher, I cannot consume a large number of big data packets in the queue, it's ok when set linkcredit to 1.
Please take a look ,thanks
Here is my code :
and here is the log :
2019/11/25 14:26:56 Sending...
14:26:56.988790 TX: Begin{RemoteChannel: 0, NextOutgoingID: 0, IncomingWindow: 65535, OutgoingWindow: 65535, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:26:56.994790 RX: Begin{RemoteChannel: 0, NextOutgoingID: 0, IncomingWindow: 65535, OutgoingWindow: 65535, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:26:56.994790 TX: Attach{Name: qDe58i39hyBwvT0w5BGi9FN6iACMkQdEXtdyD1R9HOIDrhqfiflRww, Handle: 0, Role: Sender, SenderSettleMode: , ReceiverSettleMode: , Source: , Target: source{Address: ipc.test, Durable: 0, ExpiryPolicy: , Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:26:56.998790 RX(Session): Attach{Name: qDe58i39hyBwvT0w5BGi9FN6iACMkQdEXtdyD1R9HOIDrhqfiflRww, Handle: 0, Role: Receiver, SenderSettleMode: , ReceiverSettleMode: , Source: , Target: source{Address: ipc.test, Durable: 0, ExpiryPolicy: session-end, Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:26:56.999791 RX(Session): Flow{NextIncomingID: 0, IncomingWindow: 65535, NextOutgoingID: 0, OutgoingWindow: 65535, Handle: 0, DeliveryCount: , LinkCredit: 65536, Available: , Drain: false, Echo: false, Properties: map[]}
14:26:57.492819 RX(Session): Disposition{Role: Receiver, First: 1, Last: 1, Settled: true, State: Accepted, Batchable: false}
14:26:57.960846 RX(Session): Disposition{Role: Receiver, First: 2, Last: 2, Settled: true, State: Accepted, Batchable: false}
14:26:58.444873 RX(Session): Disposition{Role: Receiver, First: 3, Last: 3, Settled: true, State: Accepted, Batchable: false}
......(ignore 4-19)
14:27:06.419329 RX(Session): Disposition{Role: Receiver, First: 20, Last: 20, Settled: true, State: Accepted, Batchable: false}
2019/11/25 14:27:06 done.
2019/11/25 14:27:06 consuming...
14:27:06.429330 TX: Begin{RemoteChannel: 0, NextOutgoingID: 0, IncomingWindow: 65535, OutgoingWindow: 65535, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:27:06.434330 RX: Begin{RemoteChannel: 0, NextOutgoingID: 0, IncomingWindow: 65535, OutgoingWindow: 65535, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:27:06.434330 TX: Attach{Name: 47e76vhclAoTfoVXAnIFK7nbORkpK3XcPNk5N-gyNxv-doVJKjb2aA, Handle: 0, Role: Receiver, SenderSettleMode: settled, ReceiverSettleMode: , Source: source{Address: ipc.test, Durable: 0, ExpiryPolicy: , Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], DistributionMode: , Filter: map[], DefaultOutcome: Outcomes: [], Capabilities: []}, Target: , Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:27:06.438330 RX(Session): Attach{Name: 47e76vhclAoTfoVXAnIFK7nbORkpK3XcPNk5N-gyNxv-doVJKjb2aA, Handle: 0, Role: Sender, SenderSettleMode: settled, ReceiverSettleMode: , Source: source{Address: ipc.test, Durable: 0, ExpiryPolicy: session-end, Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], DistributionMode: , Filter: map[], DefaultOutcome: ReleasedOutcomes: [amqp:accepted:list amqp:rejected:list amqp:released:list], Capabilities: []}, Target: , Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:27:06.438330 TX: Attach{Name: 2TXU9juZrYMuyPCfQK7EpNaQvzoKfrWfsBGvwaXL7rjXzU-0fZLshg, Handle: 1, Role: Sender, SenderSettleMode: , ReceiverSettleMode: , Source: , Target: source{Address: connHeartbeat, Durable: 0, ExpiryPolicy: , Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:27:06.438330 TX(Session): Flow{NextIncomingID: 0, IncomingWindow: 65535, NextOutgoingID: 0, OutgoingWindow: 65535, Handle: 0, DeliveryCount: 0, LinkCredit: 2, Available: , Drain: false, Echo: false, Properties: map[]}
14:27:06.441331 RX(Session): Attach{Name: 2TXU9juZrYMuyPCfQK7EpNaQvzoKfrWfsBGvwaXL7rjXzU-0fZLshg, Handle: 1, Role: Receiver, SenderSettleMode: , ReceiverSettleMode: , Source: , Target: source{Address: connHeartbeat, Durable: 0, ExpiryPolicy: session-end, Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0,
MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
14:27:06.441331 RX(Session): Flow{NextIncomingID: 0, IncomingWindow: 65535, NextOutgoingID: 0, OutgoingWindow: 65535, Handle: 1, DeliveryCount: , LinkCredit: 65536, Available: , Drain: false, Echo: false, Properties: map[]}
14:27:06.441331 RX(Session): Flow{NextIncomingID: 0, IncomingWindow: 65535, NextOutgoingID: 0, OutgoingWindow: 65535, Handle: 0, DeliveryCount: 0, LinkCredit: 2, Available: 20, Drain: false, Echo: false, Properties: map[]}
14:27:07.246377 RX(Session): Transfer{Handle: 0, DeliveryID: 0, DeliveryTag: "\x00\x00\x00\x00\x00\x00\x00\x01", MessageFormat: 0, Settled: true, More: true, ReceiverSettleMode: , State: , Resume: false, Aborted: false, Batchable: false, Payload [size]: 1048542}
14:27:11.936645 RX(Session): Transfer{Handle: 0, DeliveryID: 0, DeliveryTag: "\x00\x00\x00\x00\x00\x00\x00\x01", MessageFormat: 0, Settled: true, More: true, ReceiverSettleMode: , State: , Resume: false, Aborted: false, Batchable: false, Payload [size]: 1048542}
14:27:20.626142 RX(Session): Transfer{Handle: 0, DeliveryID: 0, DeliveryTag: "\x00\x00\x00\x00\x00\x00\x00\x01", MessageFormat: 0, Settled: true, More: true, ReceiverSettleMode: , State: , Resume: false, Aborted: false, Batchable: false, Payload [size]: 1048542}
14:27:32.458819 RX(Session): Transfer{Handle: 0, DeliveryID: 0, DeliveryTag: "\x00\x00\x00\x00\x00\x00\x00\x01", MessageFormat: 0, Settled: true, More: true, ReceiverSettleMode: , State: , Resume: false, Aborted: false, Batchable: false, Payload [size]: 1048542}
14:27:46.957648 RX(Session): Transfer{Handle: 0, DeliveryID: 0, DeliveryTag: "\x00\x00\x00\x00\x00\x00\x00\x01", MessageFormat: 0, Settled: true, More: true, ReceiverSettleMode: , State: , Resume: false, Aborted: false, Batchable: false, Payload [size]: 1048542}
14:27:46.959648 RX(Session): Transfer{Handle: 0, DeliveryID: 0, DeliveryTag: "\x00\x00\x00\x00\x00\x00\x00\x01", MessageFormat: 0, Settled: true, More: false, ReceiverSettleMode: , State: , Resume: false, Aborted: false, Batchable: false, Payload [size]: 222}
2019/11/25 14:27:46 count: 1
14:27:46.998650 TX(Session): Flow{NextIncomingID: 6, IncomingWindow: 65535, NextOutgoingID: 2, OutgoingWindow: 65535, Handle: 0, DeliveryCount: 1, LinkCredit: 2, Available: , Drain: false, Echo: false, Properties: map[]}
2019/11/25 14:27:59 read tcp 192.168.4.125:61393->192.168.8.6:5672: wsarecv: An existing connection was forcibly closed by the remote host.
The text was updated successfully, but these errors were encountered: