Ticket #315 (closed Bugs: fixed)

Opened 8 years ago

Last modified 8 years ago

Stalled connections are not handled gracefully

Reported by: sugi Owned by:
Priority: normal Milestone: 2.0
Component: LogicMail Version: 2.0.0
Keywords: Cc:
Blocked By: Blocking:


Reproducible every time I use LM and drive through a specific tunnel where the mobile connection is unavailable for ~5-10 seconds. LM will still try to keep using the connection and apparently send commands through it (I'm usually deleting messages when I am driving through the tunnel). Opening emails does not show any content even after waiting some minutes. Also the commands do not seem to arrive at the server - the emails are still there when checking later, indicating that this TCP connection is completely down.

When closing LM, it hangs for several minutes until the OS notices that it is hung and terminates it.

Version: beta

Change History

comment:1 Changed 8 years ago by octo

  • Milestone set to 2.0
  • Summary changed from LM does not seem to notice broken connections to Stalled connections are not handled gracefully

The main issue here appears to be a case of a stalled connection while server commands are in-flight. (If the connection was obviously broken, it would be detected immediately.) What basically happens is that the network connection simply stops passing data. It'll eventually time out and die, but not quite as quickly as you'd like.

I have extensive workaround code to deal with failed commands during a folder refresh, or other complex multi-step operations. However, I'm probably not doing anything in the case of a simple failed standalone flag change (e.g. marking a message as deleted).

I'll need to do some thinking about the ways this can be solved. I may not be able to detect the hung connection any faster, but I could certainly handle the condition a bit more gracefully.

The hanging on shutdown is covered by ticket #285 and is the sort of issue thats far more difficult to test and code around than we all wish it was. Still, it does need to be either solved or sufficiently hidden from the user.

comment:2 Changed 8 years ago by sugi

Actually it's noticeable, when you try to open an email and LM is waiting for data from the server.

Since no data seems to make it back to LM, what about a simple timer that keeps track of when LM last received data through the connection? Then if data was requested but not delivered within e.g. 60 seconds, and no data has been received through this connection within 60 seconds, consider it as broken?

This way if data from other commands is arriving through the connection (even if it's slow), it will be considered alive and the only overhead are timeouts and one timestamp variable for the connection.

Last edited 8 years ago by sugi (previous) (diff)

comment:3 Changed 8 years ago by octo

  • Status changed from new to closed
  • Resolution set to fixed

Closing because 2.1 takes a better approach to handling this.

Note: See TracTickets for help on using tickets.