Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
d26d15ba
Unverified
Commit
d26d15ba
authored
3 years ago
by
Erik Johnston
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug when running presence off master (#10149)
Hopefully fixes #10027.
parent
b31daac0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/10149.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/10149.bugfix
synapse/storage/databases/main/presence.py
+1
-1
1 addition, 1 deletion
synapse/storage/databases/main/presence.py
synapse/storage/util/id_generators.py
+15
-0
15 additions, 0 deletions
synapse/storage/util/id_generators.py
with
17 additions
and
1 deletion
changelog.d/10149.bugfix
0 → 100644
+
1
−
0
View file @
d26d15ba
Fix a bug which caused presence updates to stop working some time after restart, when using a presence writer worker.
This diff is collapsed.
Click to expand it.
synapse/storage/databases/main/presence.py
+
1
−
1
View file @
d26d15ba
...
...
@@ -50,7 +50,7 @@ class PresenceStore(SQLBaseStore):
instance_name
=
self
.
_instance_name
,
tables
=
[(
"
presence_stream
"
,
"
instance_name
"
,
"
stream_id
"
)],
sequence_name
=
"
presence_stream_sequence
"
,
writers
=
hs
.
config
.
worker
.
writers
.
to_devi
ce
,
writers
=
hs
.
config
.
worker
.
writers
.
presen
ce
,
)
else
:
self
.
_presence_id_gen
=
StreamIdGenerator
(
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/util/id_generators.py
+
15
−
0
View file @
d26d15ba
...
...
@@ -397,6 +397,11 @@ class MultiWriterIdGenerator:
# ... persist event ...
"""
# If we have a list of instances that are allowed to write to this
# stream, make sure we're in it.
if
self
.
_writers
and
self
.
_instance_name
not
in
self
.
_writers
:
raise
Exception
(
"
Tried to allocate stream ID on non-writer
"
)
return
_MultiWriterCtxManager
(
self
)
def
get_next_mult
(
self
,
n
:
int
):
...
...
@@ -406,6 +411,11 @@ class MultiWriterIdGenerator:
# ... persist events ...
"""
# If we have a list of instances that are allowed to write to this
# stream, make sure we're in it.
if
self
.
_writers
and
self
.
_instance_name
not
in
self
.
_writers
:
raise
Exception
(
"
Tried to allocate stream ID on non-writer
"
)
return
_MultiWriterCtxManager
(
self
,
n
)
def
get_next_txn
(
self
,
txn
:
LoggingTransaction
):
...
...
@@ -416,6 +426,11 @@ class MultiWriterIdGenerator:
# ... persist event ...
"""
# If we have a list of instances that are allowed to write to this
# stream, make sure we're in it.
if
self
.
_writers
and
self
.
_instance_name
not
in
self
.
_writers
:
raise
Exception
(
"
Tried to allocate stream ID on non-writer
"
)
next_id
=
self
.
_load_next_id_txn
(
txn
)
with
self
.
_lock
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment