Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Done
-
proton-c-0.17.0
-
None
-
None
Description
Two settings are available to throttle incoming traffic. These operate in units of bytes:
- pn_transport_set_max_frame
- pn_session_set_incoming_capacity
Suppose a user sets a max_frame to 1 Mbyte and incoming_capacity to 2 Mbytes. How many 200-byte hello-world messages might a user expect to be able to receive before the local incoming-window closes? 10,000? The answer turns out to be 2.
The logical disconnect is that the user interface incoming_capacity operates in bytes but the AMQP protocol over the wire operates with an Incoming-Window in frames. In the user's case the API assumes full frames and sets Incoming-Window = (incoming_capacity / max_frame), or 2. When the sending peer sends 200-byte messages the actual incoming capacity is 400 bytes and not 2Mbytes.
The rules (AFAICT) are:
IF (max_size is specified) incoming_window = incoming_capacity / max_size ELSE incoming_window = 2147473647 ENDIF
Noting:
- Incoming capacity is achieved only if the peer sends max_size frames.
- If max_frame is not set then the incoming_capacity setting is ignored.
Attachments
Issue Links
- is part of
-
PROTON-636 remove confusing default for session capacity and allow disabling it
- Closed
- is related to
-
PROTON-1809 [python, ruby] Unable to receive messages when max-frame-size is set to more than 2^20
- Closed