Comment 21 for bug 1794702

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/47485
Committed: http://github.com/Juniper/contrail-controller/commit/75a15427ba70f4498a676d6aa23995f1b78b1330
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit 75a15427ba70f4498a676d6aa23995f1b78b1330
Author: Pramodh D'Souza <email address hidden>
Date: Thu Nov 1 16:41:55 2018 -0700

Prevent Agent crashes due to buffer overrun

Currently a fixed buffer of 4096 bytes is used while encoding xmpp messages
sent to the control node. The size of the message varies depending on
configuration and features enabled, hence is not easy to estimate the maximum
xmpp message size. The xmpp messages tend to be quite large since they are in
plain text format and are encoded based on the names of fields in the schema
(.xsd), some names are rather lenghty, when such elements are a list the
messages explode in size. It should be noted that for routes, the real limit
would be reached by BGP on the Control Node where the same routes could be one
twentieth of the sizeof the xmpp message. The control node handles the case
where the route is too large to send in a single update message. After
considering the pros and cons it seems better to use a variable buffer on the
Agent while encoding messages sent to the Control Node just as the Control Node
does when sending messages to the Agent. Moreover just chainging the buffer
size to some arbitrary size still leaves us with the problem of explaining
limitiations to customers in terms of how many extended communities, tags etc
will be supported. Note that when this problem occurs the agent is likely to
continously reboot and not recover and could also potentially exhibit strange
behaviour due to memory corruption.

Change-Id: Iddc7ef653a5dbad3307bdabfbe691b569c866985
Closes-Bug: 1794702