Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the netlink socket read logic for dump/bulk-get
To accommodate a stream interface (TCP) to vRouter, logic was added to detect when to break out of a socket receive in place of a clean sweep of the socket buffer for datagram sockets (stream interface is blocking, since non-blocking interface does not make sense for utilities) and that logic has turned out to be buggy. For a dump/bulk get, vRouter sends a response message, followed by the bulk record message, followed by a netlink DONE message. The bulk record message is limited to what can be held in a single page. If there are more records to be fetched, more dump requests have to be sent with appropriate last seen record, which serves as a marker. With the current logic present in all the utilities, for a single dump request, all messages are read from the socket except for the DONE. When a subsequent dump request is sent with the last seen record and read is performed on the socket, the DONE message is returned with no valid sandesh message. Since the application knows that more records are to be read, it sends the same dump request again, resulting in two identical bulk record responses and duplicate outputs. For dump/bulk-get, the fix ensures that all messages are read from the socket till a DONE is processed. Change-Id: Ia52dce5df9191abc30b9a5e9b76786e1fad4646f Closes-BUG: #1459106
- Loading branch information
1 parent
d04ad9b
commit 44a9821
Showing
5 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters