#606 ✓fixreleased
Patrick

Problem with mailmate running for a period of time causes an unavailable status.

Reported by Patrick | January 23rd, 2014 @ 06:17 PM

like the title says, the program loses connection with the imap account and will not reopen it. under sources it says (unavailable)

from the failed state:

s11 logout:

Clearing connection to imap.gmail.com
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 993
Error: Error while waiting on read or write.
Error: Failed while trying to connect to “imap.gmail.com”.
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 143
Error: Error while waiting on read or write.
Error: Failed while trying to connect to “imap.gmail.com”.
repeated ~6 times

D104 capability and D0 capability are blank

Comments and changes to this ticket

  • benny

    benny January 24th, 2014 @ 12:25 PM

    Could you hold down ⌥ when clicking “Check Now” in the Software Update preferences pane to fetch the latest test version (r3962). It outputs a little bit more in the errors you describe. I would like to see that.

  • benny

    benny January 28th, 2014 @ 10:24 AM

    The output above does not include what I added for r3962. Are you sure you were running this version of MailMate:

    This:

    Error: Error while waiting on read or write.
    

    Should have been something like:

    Error: Error while waiting on read or write (<some system error message>).
    

    You can use the About window in MailMate to see the revision of MailMate you are running.

    Thanks in advance.

  • benny

    benny January 30th, 2014 @ 08:56 PM

    It never works now or is this the behavior you see after a while?

    Could you restart MailMate, open the Activity Viewer as quickly as possible and then provide the log of one of these hanging connections?

  • benny

    benny February 3rd, 2014 @ 12:17 PM

    Yes, it was the log when it failed to work I was interested in.

    I'm going to ask you to fetch another test version (r3990). I'd like to see output like what you provided above when it fails again. There is a small addition of an error number which I had forgotten to output in the previous test version.

    I also did some other changes and there is a small chance that one of these changes fixed the problem.

  • benny

    benny February 4th, 2014 @ 11:32 AM

    @Maciej: I'm sorry to hear that. I'll do what I can to resolve this. Unfortunately I made (yet another) error in the error output. I've fixed that and you can fetch a new test version (r3994). Please try that and provide the output again when it fails. Thanks in advance!

  • benny

    benny February 4th, 2014 @ 08:34 PM

    Thanks Patrick, I need it from r3994.

    IMAP requires each command to be prefixed by a so-called tag (not a MailMate tag). This tag is then used when the server has finished replying to the command such that the email client can match commands with replies. MailMate creates tags based on the type of command used (that's the letter) and a simple increasing integer. It has no other meaning than that.

  • benny

    benny February 5th, 2014 @ 08:52 AM

    @Maciej: Thanks for your patience. I'm ready for another round with r4001. I've tried outputting a bit more about the “Invalid argument” and I've inserted some more sanity checks. One of them might even crash MailMate, but that'll just mean I'm getting closer to the heart of the problem :-)

    @Patrick: If you send me output then it should also be from r4001.

  • benny

    benny February 6th, 2014 @ 08:38 AM

    Perfect. The timeout value is completely off. Now I just need to figure out why :-) I'll get back to you, but I'm optimistic that this is a solvable problem.

  • benny

    benny February 6th, 2014 @ 10:30 AM

    You can download r4005 now. I haven't really tested the fix, but the fix was pretty trivial (that's probably hubris).

    Explanation: Every read/write action with a server involves a timeout value in order to detect when a connection has been lost. Some connections/servers are fast and some are slow. MailMate starts out with a small timeout value and if it times out then the next attempt is going to have a larger timeout value. It is actually doubled every time, but it should only happen a few times since it'll then become a permanent error reported to the user. The problem is that MailMate did not reset this timeout value correctly when starting a new action. Given enough time and the occasional timeout error (~20 times) then the timeout value would become so large that it triggered the error reported above. At the same time it could make MailMate hang a long time for a connection before realizing the connection had been lost. Stupid bug. I'm thankful that I had some patient users helping me to track this down.

    (Note that some users can run MailMate for weeks without ever seeing this problem and some users, apparently, only need a few hours. It depends on the internet connection and the server.)

  • benny

    benny February 8th, 2014 @ 08:34 AM

    • State changed from “new” to “fixcommitted”

    Great, I'll close the ticket. Let me know if the problem resurfaces.

    Thanks for your help! I'm very happy that this bug was found and fixed.

  • benny

    benny March 10th, 2014 @ 01:33 PM

    @Stuart: I can see you are now following #651. We'll deal with the issue in that ticket (and see if it is related to Patrick's issue).

  • benny

    benny October 15th, 2014 @ 03:32 PM

    • State changed from “fixcommitted” to “fixreleased”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages