Possibly high amount of resolution failures after switch to resolvematrix #2019
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity#2019
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some users have reported abnormally high amounts of resolutions falling through to DefaultPort (6), sometimes as high as 70-80% of cache.
I have started investigations, will try to see why these numbers are so high. There is a strong possibility that the numbers themselves are the same, but with the changes they are being actually shown as DefaultPort (instead of not shown at all), i.e. no bug or regression at all.
First mention in support room: https://matrix.to/#/!c10y-t1HZB9jgYr9mmaKtMDsS19HXbWRFc6d0bWGVYU/%24hioIXq2q4gAA80ZotSwHh_JMgNbIhqxV-qJ1aYtUjsA?via=wolfgirl.pet&via=explodie.org&via=matrix.org
I sent a
curl "https://${DOMAIN}/.well-known/matrix/server"across 4733 domains to see status on those:Error codes are from https://everything.curl.dev/cmdline/exitcode.html, the unknown codes are
The various FAIL statuses would all fall over to step 4, which if SRV has not been set up would fall further to step 6, i.e. DefaultPort.
(The sum of the FAILs is
669+474+221+133+101+97+5+3+1+1+1 = 1706.)My next step is to check the servers for SRV status, and correlate this with the fail statuses, and see which servers would correctly fall to DefaultPort status.
There is 100% something broken somewhere. I have now gone through the files I got sent, and multiple of them have DefaultPort as the final resolution target despite the host itself resolving just fine on my end.
However, I have no idea why this happens. Looking at the code and the files I've received, the best I can think of is some transient error that happened to make the resolution become DefaultPort.
Best solution I can think of as of right now is to give DefaultPort resolutions a lower TTL than anything else, just in case they are erroneous resolutions. However, this would also cause dead servers (domains with no server behind them anymore) to be re-resolved repeatedly, causing extra strain on everything.
Maybe a slightly wild but perhaps good idea, if a certain server has incoming federation to continuwuity, but it failed to resolve (DefaultPort and a basic connectivity check fails?), attempt to resolve again? If it fails, store DefaultPort with a higher TTL, exponential with a maximum of 24 hours. This doesn't fix the underlying issue but likely mitigates some of the failures, especially those surfacing from transient network errors. On my own homeserver, federation often fails due to this issue, and I do not quite understand why.
discussion in in dev room:
I agree with the assessment, re-resolving purely based on DefaultPort would lead to too many re-resolutions and higher server load with very little benefit.
I didn't exactly mean immediately re-resolving, just increasing/doubling the TTL each time a failure occurs and it is clear that resolution failed (for example,
/_matrix/federation/v1/versiondoes not result in 200), but then again it might depend on whether the resolution was successful or not in the first place, but this might be hard to distinguish in some cases.server resolution can't fail
Sure it can? No delegation, no SRV, default port closed?
if there's no delegation, srv, and default port is closed then it didnt fail, its the server which has closed their ways of communicating, resolution still succeeded as per the spec:
This is the last step of resolution, which doesn't care if the port is closed
That is spec, but obviously, your policy on how to then deal with the result of the resolution may still depend on implementation details.
Our policy on how to deal with it will probably be "mark as failed on federation failure, unmark when they send us a request again or after a set time period"
Yeah I've tried to dig more into this issue, and I really don't understand why it's happening. With the addition of #2097, hopefully errored servers should re-resolve correctly if they got incorrectly resolved in the first place, but that remains to be seen. Closing this issue for now.