Closed philgyford closed 2 years ago
One other thought - should it be possible to create duplicate OutgoingWebmentionStatus
objects, like it is at the moment?
Maybe ensure that source_url
and target_url
are unique together (unless there's some reason that would break something else that I'm missing)?
While that wouldn't fix the cause of the problem, it would prevent the symptom of thousands of identical outgoing statuses building up in the DB.
Hey,
If you are upgrading to 3.0.0
be aware that the migrations will delete and recreate the PendingIncomingWebmention
and PendingOutgoingContent
models which will also delete any existing instances of those models. If you want to keep them please don't upgrade yet and let me know - I will add a management command to transfer them between versions.
Sorry this took such a long time to get out - especially for this particularly broken issue, but also all the others you reported. Thanks again for raising them, and for providing such detailed reports. They should all now be fixed!
Wow, that's a lot of work for 3.0.0, well done! Thank you so much for all that. I should be able to try it out in the next couple of days. I don't think there's much/anything I need to keep in the pending lists, or I can recreate one or two if necessary. I'll let you know how it goes.
Just wanted to say I've upgraded to 3.0.0 and things seem to be working well. Thank you so much, again!
I had to run makemigrations
for the model that used MentionableMixin
, due to the understandable removal of that one field, but otherwise all was smooth.
One thought for a tweak - usually an app's templates are within an app-specific directory. So, rather than the templates being in django-wm/mentions/templates/
they'd be in django-wm/mentions/templates/mentions/
. Then, if the end user wants to override a template, their overriding templates would live in a templates/mentions/
directory in their project, rather than rattling around loose in templates/
.
Oops, just noticed your comment about the template location just now - will fix in the next release.
I'm not entirely clear how or why this started or continued but, from what I can tell, going back to the first instance of the error in Sentry for my website...
When sending outgoing webmentions, requests timed out and generated an error. I think this meant that the code stopped, with the new
PendingOutgoingContent
object created but not deleted. Then next time the script runs, it creates anotherPendingOutgoingContent
object and tries again, and repeat. A month later I actually notice this is happening and I have 37,000 outgoing webmention statuses, mostly from this post and then more duplicates from subsequent ones!It's possible it's related to several of the links being from my website to other posts on my site (or
#anchor
links to the same page (#32)) and so the server is coping with both opening outgoing connections and handling the incoming ones - maybe if something's slow it uses up its connections and so everything gets even slower, etc, etc.Anyway. Here's the traceback from the first time it happened:
And here's the "breadcrumbs" from Sentry (updated to correct image since I first posted this):
A couple of things that we could do:
requests
which the docs say should always be done. That would at least make failure happen more quickly. Given I was running the management command every 10 minutes (too frequently in retrospect!) the server was spending a lot of time trying to send webmentions!PendingOutgoingContent
object, so I'm not sure what should happen to it if a connection fails, but maybe there's something to do there?FWIW, when I've used
requests
in the past this is what I've done, which feels rather too laborious but I pieced it together from trying to capture all the possible failures:(It's also possible I'm entirely misreading what's caused this!)