Skip to content
Snippets Groups Projects
  1. Sep 30, 2020
    • Erik Johnston's avatar
      Make token serializing/deserializing async (#8427) · 7941372e
      Erik Johnston authored
      The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
      7941372e
    • Patrick Cloke's avatar
    • Richard van der Hoff's avatar
      Rewrite BucketCollector · 6d2d42f8
      Richard van der Hoff authored
      This was a bit unweildy for what I wanted: in particular, I wanted to assign
      each measurement straight into a bucket, rather than storing an intermediate
      Counter which didn't do any bucketing at all.
      
      I've replaced it with something that is hopefully a bit easier to use.
      
      (I'm not entirely sure what the difference between a HistogramMetricFamily and
      a GaugeHistogramMetricFamily is, but given our counters can go down as well as
      up the latter *sounds* more accurate?)
      6d2d42f8
  2. Sep 29, 2020
    • Erik Johnston's avatar
      ea70f1c3
    • Erik Johnston's avatar
      Don't table scan events on worker startup (#8419) · b1433bf2
      Erik Johnston authored
      
      * Fix table scan of events on worker startup.
      
      This happened because we assumed "new" writers had an initial stream
      position of 0, so the replication code tried to fetch all events written
      by the instance between 0 and the current position.
      
      Instead, set the initial position of new writers to the current
      persisted up to position, on the assumption that new writers won't have
      written anything before that point.
      
      * Consider old writers coming back as "new".
      
      Otherwise we'd try and fetch entries between the old stale token and the
      current position, even though it won't have written any rows.
      
      Co-authored-by: default avatarAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>
      
      Co-authored-by: default avatarAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>
      b1433bf2
    • Will Hunt's avatar
      Filter out appservices from mau count (#8404) · 8676d8ab
      Will Hunt authored
      This is an attempt to fix #8403.
      8676d8ab
    • Andrew Morgan's avatar
      Only assert valid next_link params when provided (#8417) · 1c6b8752
      Andrew Morgan authored
      Broken in https://github.com/matrix-org/synapse/pull/8275 and has yet to be put in a release. Fixes https://github.com/matrix-org/synapse/issues/8418.
      
      `next_link` is an optional parameter. However, we were checking whether the `next_link` param was valid, even if it wasn't provided. In that case, `next_link` was `None`, which would clearly not be a valid URL.
      
      This would prevent password reset and other operations if `next_link` was not provided, and the `next_link_domain_whitelist` config option was set.
      1c6b8752
    • 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
  3. Sep 28, 2020
  4. Sep 25, 2020
    • Richard van der Hoff's avatar
      Fix occasional "Re-starting finished log context" from keyring (#8398) · fec6f9ac
      Richard van der Hoff authored
      * Fix test_verify_json_objects_for_server_awaits_previous_requests
      
      It turns out that this wasn't really testing what it thought it was testing
      (in particular, `check_context` was turning failures into success, which was
      making the tests pass even though it wasn't clear they should have been.
      
      It was also somewhat overcomplex - we can test what it was trying to test
      without mocking out perspectives servers.
      
      * Fix warnings about finished logcontexts in the keyring
      
      We need to make sure that we finish the key fetching magic before we run the
      verifying code, to ensure that we don't mess up our logcontexts.
      fec6f9ac
    • Tdxdxoz's avatar
      Allow existing users to login via OpenID Connect. (#8345) · abd04b6a
      Tdxdxoz authored
      
      Co-authored-by: default avatarBenjamin Koch <bbbsnowball@gmail.com>
      
      This adds configuration flags that will match a user to pre-existing users
      when logging in via OpenID Connect. This is useful when switching to
      an existing SSO system.
      abd04b6a
  5. Sep 24, 2020
    • Erik Johnston's avatar
      Fix MultiWriteIdGenerator's handling of restarts. (#8374) · f112cfe5
      Erik Johnston authored
      On startup `MultiWriteIdGenerator` fetches the maximum stream ID for
      each instance from the table and uses that as its initial "current
      position" for each writer. This is problematic as a) it involves either
      a scan of events table or an index (neither of which is ideal), and b)
      if rows are being persisted out of order elsewhere while the process
      restarts then using the maximum stream ID is not correct. This could
      theoretically lead to race conditions where e.g. events that are
      persisted out of order are not sent down sync streams.
      
      We fix this by creating a new table that tracks the current positions of
      each writer to the stream, and update it each time we finish persisting
      a new entry. This is a relatively small overhead when persisting events.
      However for the cache invalidation stream this is a much bigger relative
      overhead, so instead we note that for invalidation we don't actually
      care about reliability over restarts (as there's no caches to
      invalidate) and simply don't bother reading and writing to the new table
      in that particular case.
      f112cfe5
    • Erik Johnston's avatar
      Add EventStreamPosition type (#8388) · ac11fcbb
      Erik Johnston authored
      The idea is to remove some of the places we pass around `int`, where it can represent one of two things:
      
      1. the position of an event in the stream; or
      2. a token that partitions the stream, used as part of the stream tokens.
      
      The valid operations are then:
      
      1. did a position happen before or after a token;
      2. get all events that happened before or after a token; and
      3. get all events between two tokens.
      
      (Note that we don't want to allow other operations as we want to change the tokens to be vector clocks rather than simple ints)
      ac11fcbb
  6. Sep 23, 2020
  7. Sep 22, 2020
  8. Sep 18, 2020
  9. Sep 15, 2020
  10. Sep 14, 2020
  11. Sep 11, 2020
  12. Sep 10, 2020
  13. Sep 09, 2020
  14. Sep 08, 2020
  15. Sep 07, 2020
  16. Sep 04, 2020
Loading