-
-
Notifications
You must be signed in to change notification settings - Fork 104
feat: advance next UID even if connection fails while fetching #6997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2c4e07b
to
504387d
Compare
did bit read the code, just by the title: if we advance UID if connection fails, we probably did not get that message. does that mean we're missing a message? |
Seems the only case when we can miss a message is when |
There was a bug in this PR that actually resulted in lost messages, fixed in the second commit. But this is just a bug. The idea of this PR is that if we have 10 messages that we decide to fetch after prefetch, and connection times out after fetching the first 4 messages, we want to advance UIDNEXT so we only prefetch the remaining 6 messages next time. Without this PR UIDNEXT did not advance in this case and we would prefetch 10 messages again on the next reconnection, even though we know that the first 4 messages are not interesting. |
Thought about converting it to draft because I realized that FETCH result order is undefined, but |
a118d4b
to
f2a59fa
Compare
Connection sometimes fails while processing FETCH responses. In this case `fetch_new_messages` exits early and does not advance next expected UID even if some messages were processed. This results in prefetching the same messages after reconnection and log messages similar to "Not moving the message ab05c85a-e191-4fd2-a951-9972bc7e167f@localhost that we have seen before.". With this change we advance next expected UID even if `fetch_new_messages` returns a network error.
f2a59fa
to
d45ec7f
Compare
Connection sometimes fails while processing FETCH
responses. In this case
fetch_new_messages
exits earlyand does not advance next expected UID even if
some messages were processed.
This results in prefetching the same messages
after reconnection and log messages
similar to
"Not moving the message ab05c85a-e191-4fd2-a951-9972bc7e167f@localhost that we have seen before.".
With this change we advance next expected UID
even if
fetch_new_messages
returns a network error.Fixes #6936