• Vincent Pelletier's avatar
    Change (again) the way timeouts are handled. · 393e59e0
    Vincent Pelletier authored
    There are 2 distinct kinds of timeout events:
    - an unresponsive node
      This is a connection-level timeout.
      This is handled by the Timeout class, triggering pings and monitoring
      incoming data to decide when remote node is considered dead.
    - a "too long" processing from an otherwise responsive node
      This is a per-request timeout.
      This is handled by the HandlerSwitcher class, triggering only
      disconnections when an answer takes too long to arrive (historical
      behaviour, not so useful when exchanging with a single-threaded peer).
    
    Previous implementation mixed both, and had shortcomings (ping would
    timeout almost immediately, it was not possible to tell which message
    caused a timeout).
    
    Update tests.
    
    git-svn-id: https://svn.erp5.org/repos/neo/trunk@2009 71dcc9de-d417-0410-9af5-da40c76e7ee4
    393e59e0
connection.py 21.7 KB