Opened 15 years ago
Last modified 14 years ago
#143 new enhancement
add PONG-sending timer
Reported by: | Brian Warner | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | eventually |
Component: | unknown | Version: | 0.4.1 |
Keywords: | Cc: |
Description
As David-Sarah Hopwood pointed out in tahoe#521, Foolscap's connection-keepalive timers might be improved by adding an outbound timer to the existing inbound- and disconnect- timers. The idea would be to ensure that we *send* data on a regular basis, not just that we've received data on a regular basis. This "PONG" timer would send an unsolicited PONG message (which is generally ignored, except to update the last-heard-from timestamp) if we had not sent any data in the previous window. It would probably be implemented by adding code to the existing PING timer (which fires when we haven't *received* data recently, with the intention of provoking a PONG response from the other end). This code would check the last-sent timestamp and send a PONG if it was too old.
The purpose of this timer would be to keep our peer's disconnect- timer from firing, especially when the peer was busy sending us a large STRING token. If the token is large enough, the peer will not be able to get a PING through to us, so we won't know to send a PONG, and the peer might then believe that we've failed to respond (even though in fact we're still connected and happily receiving data). This false-disconnect would be the result of application-level messages not getting through (blocked by other app-level messages), even though the transport-level messages *were* getting through.