azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

[BUG] Service Bus Web socket connection frame size too small

Open elFarto opened this issue 2 years ago • 0 comments

Describe the bug I've noticed some situations where reading messages from a service bus can get stuck, especially when retrieving a large amount of maxMessages. When this happens the CPU usage of the process jumps to 100% of one core. I believe I've traced this issue back to the frame size of the websocket connection being limited to 4,224bytes, rather than the 262,144 or 1,048,576 bytes that Service Bus supports.

The process seems to be locked up in an endless loop of trying to copy bytes to a ByteBuffer that's already full, so it continually copies 0 bytes. The underlying Qpid library does now support passing a custom max frame size, so the code should be modified to use that.

To Reproduce Attempt to recieve a message larger than 4,224 bytes.

Expected behavior A large frame should not lock up the process.

Setup (please complete the following information):

  • OS: Windows
  • Library/Libraries: com.azure:azure-messaging-servicebus:7.14.3
  • Java version: 17
  • Frameworks: Spring Boot

elFarto avatar Oct 26 '23 09:10 elFarto