This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add endpoints for backfilling history (MSC2716) #9247
Add endpoints for backfilling history (MSC2716) #9247
Changes from all commits
22c038e
4836954
c0b0936
bf90053
bcc6943
7f4c3a6
800f3a3
9b5e057
447eaa8
7ec22b5
afa5e5d
f1f3fb0
e7d7f92
b9024f7
d204880
dbba361
f1c31f1
19aa93c
c074584
c02079d
412ffc3
7160f3b
5ff398d
864b98f
6f174f1
ba1eb39
6d4fcb6
5d5fb8b
ed76d5f
1aa3af9
e63ef8e
c90af9e
270e5ee
4359ab8
641e871
6d8514f
5dacc86
61dc89f
e12a77d
8549219
6c96622
23d0379
ea37564
7008ee0
0d4736f
49631e5
06dccec
8e0684d
cbd16b8
044a761
86ec915
81b45b5
02b7335
82708cb
f0fb732
c525c5d
5deee7c
960ec21
779ef25
7dcc0fa
52b1e7b
1d6cf78
13b18a8
3d513bf
e92a9e9
e9ae5e1
a978f38
2c22929
0501a11
e231a99
176a854
a6a05f8
25aef56
0580d09
ef68832
d8316d6
513d7a2
f36bdde
c2e1924
88327fb
34f130c
2f35954
6ce47d3
b032370
22881e2
ae85719
d59d6be
c236a3c
429e130
29c3708
89e08c5
bfe458c
2c1750f
e851dac
7dcbba9
f7158ff
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need to change the behaviour of getting backfill from the DB? Or are we punting that to a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to work on the insertion/marker event logic in another PR after this merges so it doesn't grow more and I don't have to keep refactoring across PR's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last test failures are coming from this new line (if I comment it out to always calculate
depth
, the tests pass). Is there a way to seelogger.info
from within the app while running thetwisted.trial
tests? I am having digging into this further without being able to log.Test failure: https://github.com/matrix-org/synapse/pull/10049/checks?check_run_id=2764607442#step:8:2373
Reproduction locally:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the env to
SYNAPSE_TEST_LOG_LEVEL=DEBUG
will give you debug logs in_trial_temp/test.log
🙂There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I accidentally set
depth
toFalse
in the tests.Found the problem first by logging what the weird
depth
value was above the line in question and saw it wasFalse
at some point:Then I added this line which will cause it to throw an exception (because no
%s
in the formatting string)when this condition is met and give us a full stack trace.Is there a better way to get a stack trace/call stack? I tried
logger.exception
and addingexc_info=True
to the logger functions but they just gave small trace back to thedefer
and don't play well with the async stuff.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documented the
SYNAPSE_TEST_LOG_LEVEL=DEBUG
( ->_trial_temp/test.log
) trick in #10148. Thanks for sharing!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you raise if depth is wrong? That gives me a good stack trace. I think the defer code does special things to make the stack traces work out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise
does work well 👍 Thanks for the better way to do this!Is there a way I can just log a line and get a stack trace without breaking the normal execution flow?
In JavaScript, I would use
console.log('something bad happened', new Error().stack);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think creating a twisted
Failure
object might work: https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/pagination.py#L285-L288, but I'm not 100% sure