-
Notifications
You must be signed in to change notification settings - Fork 58
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
['+ idling from'] from imap_client.wait_server_push() #30
Comments
this is the continuation (starting with +) sent by the server after the IDLE command. That just means that the client will wait events from the server. |
I understand that. I don’t really understand why should I receive |
It seems that stop_wait_server_push has been done just before receiving It is not easy to throw away |
Thank you. In the log, when there is Let me know if I can help. |
Hey @vert-rouge (hope you are fine BTW I did not recognized your avatar on my phone). I suspect a race condition between the new message received at 14:23:21,641 and the IDLE DONE. Just looked the code, it seems that it comes from the But I don't know why at 14:23:15,550 or in other cases it does not happen. I'll take a closer look. Sorry for the delay.. |
Use an event to wait/signal that the IDLE command has been acknowledged by receipt of a continuation line from the server, avoiding the idle_queue. When starting idle mode (idle_start), it isn't safe to assume that the results of reading from the idle queue is a continuation line, as the queue may have other content, such as: - an unsolicited server keepalive that just happens to arrive while the IDLE command is starting - an EXISTS from a previous IDLE loop (see bamthomas#30) - a 'stop_wait_server_push' from a previous IDLE loop, if the idle timeout coincided with receipt of a message from the server. Calling code should probably be draining the queue before initiating a new loop, but that wouldn't prevent an unsolicited server keepalive from racing. Fixes bamthomas#30
Use an event to wait/signal that the IDLE command has been acknowledged by receipt of a continuation line from the server, avoiding the idle_queue. When starting idle mode (idle_start), it isn't safe to assume that the results of reading from the idle queue is a continuation line, as the queue may have other content, such as: - an unsolicited server message that just happens to arrive while the IDLE command is starting - an EXISTS from a previous IDLE loop (see bamthomas#30) - a 'stop_wait_server_push' from a previous IDLE loop, if the idle timeout coincided with receipt of a message from the server. Calling code should probably be draining the queue before initiating a new loop, but that wouldn't prevent an unsolicited server messages from racing. Fixes bamthomas#30
Use an event to wait/signal that the IDLE command has been acknowledged by receipt of a continuation line from the server, avoiding the idle_queue. When starting idle mode (idle_start), it isn't safe to assume that the results of reading from the idle queue is a continuation line, as the queue may have other content, such as: - an unsolicited server message that just happens to arrive while the IDLE command is starting - an EXISTS from a previous IDLE loop (see bamthomas#30) - a 'stop_wait_server_push' from a previous IDLE loop, if the idle timeout coincided with receipt of a message from the server. Calling code should probably be draining the queue before initiating a new loop, but that wouldn't prevent an unsolicited server message from racing. Fixes bamthomas#30
Use an event to wait/signal that the IDLE command has been acknowledged by receipt of a continuation line from the server, avoiding the idle_queue. When starting idle mode (idle_start), it isn't safe to assume that the results of reading from the idle queue is a continuation line, as the queue may have other content, such as: - an unsolicited server message that just happens to arrive while the IDLE command is starting - an EXISTS from a previous IDLE loop (see bamthomas#30) - a 'stop_wait_server_push' from a previous IDLE loop, if the idle timeout coincided with receipt of a message from the server. Calling code should probably be draining the queue before initiating a new loop, but that wouldn't prevent an unsolicited server message from racing. Fixes bamthomas#30
@darkrain42 any update on the fix for the race condition? I am facing the same issue when I checked out the DEBUG logs and it seems to be an important functional issue within the library. |
One workaround I used:
So check if the idle_queue is empty before restarting the idle waiting, else handle the messages in the queue until empty. |
I'm pretty happy with the fix I coded. I can't test it currently, because aioimaplib fails more fundamentally for me (Debian sid has python 3.9), and I was waiting for #52 to be merged, to then rebase on top of that. I think your workaround is valid. |
hello @darkrain42 thanks for your feedback, I've looked at the code you made and the test is great. I'd rather merge your code first, could do a PR with what you did ? |
Hi
In a coroutine, I have
sometimes I got the following debug:
I don’t understand why I have this line ['+ idling']
I’m using dovecot as the imap server.
The text was updated successfully, but these errors were encountered: