Skip to content
Snippets Groups Projects
  1. Sep 29, 2020
    • Richard van der Hoff's avatar
      Fix handling of connection timeouts in outgoing http requests (#8400) · 1c262431
      Richard van der Hoff authored
      
      * Remove `on_timeout_cancel` from `timeout_deferred`
      
      The `on_timeout_cancel` param to `timeout_deferred` wasn't always called on a
      timeout (in particular if the canceller raised an exception), so it was
      unreliable. It was also only used in one place, and to be honest it's easier to
      do what it does a different way.
      
      * Fix handling of connection timeouts in outgoing http requests
      
      Turns out that if we get a timeout during connection, then a different
      exception is raised, which wasn't always handled correctly.
      
      To fix it, catch the exception in SimpleHttpClient and turn it into a
      RequestTimedOutError (which is already a documented exception).
      
      Also add a description to RequestTimedOutError so that we can see which stage
      it failed at.
      
      * Fix incorrect handling of timeouts reading federation responses
      
      This was trapping the wrong sort of TimeoutError, so was never being hit.
      
      The effect was relatively minor, but we should fix this so that it does the
      expected thing.
      
      * Fix inconsistent handling of `timeout` param between methods
      
      `get_json`, `put_json` and `delete_json` were applying a different timeout to
      the response body to `post_json`; bring them in line and test.
      
      Co-authored-by: default avatarPatrick Cloke <clokep@users.noreply.github.com>
      Co-authored-by: default avatarErik Johnston <erik@matrix.org>
      1c262431
  2. Sep 10, 2020
  3. Aug 27, 2020
  4. Jul 30, 2020
  5. Mar 24, 2020
    • Richard van der Hoff's avatar
      Clean up some LoggingContext stuff (#7120) · 39230d21
      Richard van der Hoff authored
      * Pull Sentinel out of LoggingContext
      
      ... and drop a few unnecessary references to it
      
      * Factor out LoggingContext.current_context
      
      move `current_context` and `set_context` out to top-level functions.
      
      Mostly this means that I can more easily trace what's actually referring to
      LoggingContext, but I think it's generally neater.
      
      * move copy-to-parent into `stop`
      
      this really just makes `start` and `stop` more symetric. It also means that it
      behaves correctly if you manually `set_log_context` rather than using the
      context manager.
      
      * Replace `LoggingContext.alive` with `finished`
      
      Turn `alive` into `finished` and make it a bit better defined.
      39230d21
  6. Jul 23, 2019
  7. Jul 03, 2019
  8. Jun 20, 2019
  9. May 13, 2019
  10. May 10, 2019
  11. Mar 20, 2019
  12. Mar 18, 2019
  13. Mar 13, 2019
  14. Feb 11, 2019
  15. Jan 25, 2019
  16. Jan 22, 2019
  17. Jan 18, 2019
  18. Jan 08, 2019
    • Erik Johnston's avatar
      Refactor request sending to have better excpetions (#4358) · b970cb0e
      Erik Johnston authored
      * Correctly retry and back off if we get a HTTPerror response
      
      * Refactor request sending to have better excpetions
      
      MatrixFederationHttpClient blindly reraised exceptions to the caller
      without differentiating "expected" failures (e.g. connection timeouts
      etc) versus more severe problems (e.g. programming errors).
      
      This commit adds a RequestSendFailed exception that is raised when
      "expected" failures happen, allowing the TransactionQueue to log them as
      warnings while allowing us to log other exceptions as actual exceptions.
      b970cb0e
  19. Sep 24, 2018
  20. Sep 18, 2018
    • Richard van der Hoff's avatar
      Refactor matrixfederationclient to fix logging (#3906) · 31c15dcb
      Richard van der Hoff authored
      We want to wait until we have read the response body before we log the request
      as complete, otherwise a confusing thing happens where the request appears to
      have completed, but we later fail it.
      
      To do this, we factor the salient details of a request out to a separate
      object, which can then keep track of the txn_id, so that it can be logged.
      31c15dcb
  21. Sep 13, 2018
Loading