Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into clokep/fix-twisted…
Browse files Browse the repository at this point in the history
…-tests
  • Loading branch information
clokep committed Oct 23, 2023
2 parents 69d0181 + 3ab861a commit 15107e6
Show file tree
Hide file tree
Showing 28 changed files with 406 additions and 161 deletions.
1 change: 1 addition & 0 deletions changelog.d/16473.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a long-standing, exceedingly rare edge case where the first event persisted by a new event persister worker might not be sent down `/sync`.
1 change: 1 addition & 0 deletions changelog.d/16521.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop deleting from an unused table.
1 change: 1 addition & 0 deletions changelog.d/16526.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve type hints.
1 change: 1 addition & 0 deletions changelog.d/16529.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve documentation of presence router.
1 change: 1 addition & 0 deletions changelog.d/16530.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Force TLS certificate verification in user registration script.
1 change: 1 addition & 0 deletions changelog.d/16531.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a sentence to the opentracing docs on how you can have jaeger in a different place than synapse.
1 change: 1 addition & 0 deletions changelog.d/16539.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump matrix-synapse-ldap3 from 0.2.2 to 0.3.0.
1 change: 1 addition & 0 deletions changelog.d/16540.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix long-standing bug where `/sync` could tightloop after restart when using SQLite.
13 changes: 10 additions & 3 deletions docs/development/synapse_architecture/streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,24 @@ will be inserted with that ID.

For any given stream reader (including writers themselves), we may define a per-writer current stream ID:

> The current stream ID _for a writer W_ is the largest stream ID such that
> A current stream ID _for a writer W_ is the largest stream ID such that
> all transactions added by W with equal or smaller ID have completed.
Similarly, there is a "linear" notion of current stream ID:

> The "linear" current stream ID is the largest stream ID such that
> A "linear" current stream ID is the largest stream ID such that
> all facts (added by any writer) with equal or smaller ID have completed.
Because different stream readers A and B learn about new facts at different times, A and B may disagree about current stream IDs.
Put differently: we should think of stream readers as being independent of each other, proceeding through a stream of facts at different rates.

The above definition does not give a unique current stream ID, in fact there can
be a range of current stream IDs. Synapse uses both the minimum and maximum IDs
for different purposes. Most often the maximum is used, as its generally
beneficial for workers to advance their IDs as soon as possible. However, the
minimum is used in situations where e.g. another worker is going to wait until
the stream advances past a position.

**NB.** For both senses of "current", that if a writer opens a transaction that never completes, the current stream ID will never advance beyond that writer's last written stream ID.

For single-writer streams, the per-writer current ID and the linear current ID are the same.
Expand Down Expand Up @@ -114,7 +121,7 @@ Writers need to track:
- track their current position (i.e. its own per-writer stream ID).
- their facts currently awaiting completion.

At startup,
At startup,
- the current position of that writer can be found by querying the database (which suggests that facts need to be written to the database atomically, in a transaction); and
- there are no facts awaiting completion.

Expand Down
14 changes: 11 additions & 3 deletions docs/modules/presence_router_callbacks.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Presence router callbacks

Presence router callbacks allow module developers to specify additional users (local or remote)
to receive certain presence updates from local users. Presence router callbacks can be
registered using the module API's `register_presence_router_callbacks` method.
Presence router callbacks allow module developers to define additional users
which receive presence updates from local users. The additional users
can be local or remote.

For example, it could be used to direct all of `@alice:example.com` (a local user)'s
presence updates to `@bob:matrix.org` (a remote user), even though they don't share a
room. (Note that those presence updates might not make it to `@bob:matrix.org`'s client
unless a similar presence router is running on that homeserver.)

Presence router callbacks can be registered using the module API's
`register_presence_router_callbacks` method.

## Callbacks

Expand Down
5 changes: 5 additions & 0 deletions docs/opentracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ docker run -d --name jaeger \
jaegertracing/all-in-one:1
```

By default, Synapse will publish traces to Jaeger on localhost.
If Jaeger is hosted elsewhere, point Synapse to the correct host by setting
`opentracing.jaeger_config.local_agent.reporting_host` [in the Synapse configuration](usage/configuration/config_documentation.md#opentracing-1)
or by setting the `JAEGER_AGENT_HOST` environment variable to the desired address.

Latest documentation is probably at
https://www.jaegertracing.io/docs/latest/getting-started.

Expand Down
115 changes: 52 additions & 63 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions synapse/_scripts/register_new_matrix_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def request_registration(
url = "%s/_synapse/admin/v1/register" % (server_location.rstrip("/"),)

# Get the nonce
r = requests.get(url, verify=False)
r = requests.get(url)

if r.status_code != 200:
_print("ERROR! Received %d %s" % (r.status_code, r.reason))
Expand Down Expand Up @@ -88,7 +88,7 @@ def request_registration(
}

_print("Sending registration request...")
r = requests.post(url, json=data, verify=False)
r = requests.post(url, json=data)

if r.status_code != 200:
_print("ERROR! Received %d %s" % (r.status_code, r.reason))
Expand Down
2 changes: 1 addition & 1 deletion synapse/replication/http/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def send_request(

data[_STREAM_POSITION_KEY] = {
"streams": {
stream.NAME: stream.current_token(local_instance_name)
stream.NAME: stream.minimal_local_current_token()
for stream in streams
},
"instance_name": local_instance_name,
Expand Down
Loading

0 comments on commit 15107e6

Please sign in to comment.