π FileMgr
π
/
usr
/
lib
/
python3
/
dist-packages
/
landscape
/
lib
/
__pycache__
βοΈ /usr/lib/python3/dist-packages/landscape/lib/__pycache__/message.cpython-312.pyc
β Tutup
οΏ½ οΏ½~οΏ½eJ οΏ½ οΏ½ οΏ½ d Z eοΏ½ ZdοΏ½ Zy)z/Helpers for reliable persistent message queues.c οΏ½l οΏ½ d}| j οΏ½ }||z | j οΏ½ kD r| j οΏ½ d}t }nP||kD r| j οΏ½ ||z }n5||| j οΏ½ z k r d}t }n| j οΏ½ |z |z }| j |οΏ½ | j |οΏ½ |S )aοΏ½ Our peer has told us what it expects our next message's sequence to be. Call this with the message store and sequence number that the peer wants next; this will do various things based on what *this* side has in its outbound queue store. 0. The peer expects a sequence number from the server that is too high, the difference greater than pending messages in the peer. We flush the older messages in queue b/c the server does not want old or ancient messages, however we also reset the offset so that the pending messages are resent. Then we resynchronize by returning RESYNC. See LP: #1917540 1. The peer expects a sequence greater than what we last sent. This is the common case and generally it should be expecting last_sent_sequence+len(messages_sent)+1. 2. The peer expects a sequence number our side has already sent, and we no longer have that message. In this case, just send *all* messages we have, including the previous generation, starting at the sequence number the peer expects (meaning that messages have probably been lost). 3. The peer expects a sequence number we already sent, and we still have that message cached. In this case, we send starting from that message. If the next expected sequence from the server refers to a message older than we have, then L{RESYNC} will be returned. NοΏ½ )οΏ½get_sequenceοΏ½count_pending_messagesοΏ½delete_old_messagesοΏ½RESYNCοΏ½get_pending_offsetοΏ½set_pending_offsetοΏ½set_sequence)οΏ½storeοΏ½ next_expectedοΏ½retοΏ½old_sequenceοΏ½pending_offsets οΏ½7/usr/lib/python3/dist-packages/landscape/lib/message.pyοΏ½got_next_expectedr sοΏ½ οΏ½ οΏ½<