Page MenuHomePhabricator

Attempt to generate thumbnail by requesting URL
Closed, ResolvedPublic

Description

As a follow-up to the parent task, one thing we can try is an HTTP GET request to the the URL associated with the thumbnail. That should result in the thumbnail getting created, which we can then make use of in jobs that send thumbnail contents to PhotoDNA.

Although when I try this, there are a bunch of Thumbor-* headers on the response so it doesn't seem like it was created by MediaWiki shelling out. So I don't really understand what's going on - thumb.php also uses RENDER_NOW internally.

I think what happens (but not at all sure about it) is that the existence check in thumb.php makes Swift/Thumbor generate that file on demand. So I think you just need to copy that logic (we should probably encapsulate it in some File method for convenience).

Event Timeline

kostajh added a subscriber: Tgr.
kostajh added a subscriber: Dreamy_Jazz.

Per the comment you quoted, I think the simpler and better option is to just call fileExists. Not sure about it but I think on Wikimedia servers that will generate the file. On non-Wikimedia servers you can keep shelling out with RENDER_NOW.

Change 994829 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/MediaModeration@master] [WIP] MediaModerationImageContentsLookup: use fileExists to generate file

https://gerrit.wikimedia.org/r/994829

Change 998703 had a related patch set uploaded (by Dreamy Jazz; author: Kosta Harlan):

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.16] MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998703

Change 994829 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/994829

Change 998704 had a related patch set uploaded (by Dreamy Jazz; author: Kosta Harlan):

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.17] MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998704

Change 998704 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.17] MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998704

Mentioned in SAL (#wikimedia-operations) [2024-02-08T14:46:54Z] <dreamyjazz@deploy2002> Started scap: Backport for [[gerrit:998704|MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-08T14:48:27Z] <dreamyjazz@deploy2002> dreamyjazz: Backport for [[gerrit:998704|MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-08T14:54:43Z] <dreamyjazz@deploy2002> Finished scap: Backport for [[gerrit:998704|MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]] (duration: 07m 49s)

Change 998703 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.16] MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998703

Mentioned in SAL (#wikimedia-operations) [2024-02-08T15:08:18Z] <dreamyjazz@deploy2002> Started scap: Backport for [[gerrit:998703|MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-08T15:09:48Z] <dreamyjazz@deploy2002> dreamyjazz: Backport for [[gerrit:998703|MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-08T15:17:01Z] <dreamyjazz@deploy2002> Finished scap: Backport for [[gerrit:998703|MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]] (duration: 08m 42s)

Change 998954 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998954

Change 998966 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.17] Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998966

Change 998967 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.16] Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998967

Change 998966 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.17] Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998966

Change 998967 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.16] Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998967

Mentioned in SAL (#wikimedia-operations) [2024-02-08T15:46:09Z] <dreamyjazz@deploy2002> Started scap: Backport for [[gerrit:998967|Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]], [[gerrit:998966|Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-08T15:47:39Z] <dreamyjazz@deploy2002> dreamyjazz: Backport for [[gerrit:998967|Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]], [[gerrit:998966|Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-08T15:54:13Z] <dreamyjazz@deploy2002> Finished scap: Backport for [[gerrit:998967|Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]], [[gerrit:998966|Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file (T356047)]] (duration: 08m 03s)

Change 998954 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Follow-up: MediaModerationImageContentsLookup: use proxied HTTP request to generate file

https://gerrit.wikimedia.org/r/998954

Djackson-ctr subscribed.

QA has been executed and no issues were found during testing.

Impact of this change (from Grafana)

Drop in request timeDrop in "source file used instead of thumbnail" instancesDrop in "Thumbnail and source image lookup failed"Drop in transform errors/warnings
image.png (690×2 px, 178 KB)
image.png (640×2 px, 100 KB)
image.png (640×2 px, 97 KB)
image.png (640×2 px, 95 KB)