Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Having issues with incomplete images being passed along for image style generation. This seems to fix them.
Comment | File | Size | Author |
---|---|---|---|
#9 | use_write_rename-2464699-1.patch | 6.71 KB | markdorison |
#1 | stage_file_proxy-2464699-1-atomic-write.patch | 4.24 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedComment #2
gregglesThis looks pretty good to me. Sorry for the slow time to a response.
I noticed: "Preform" -> Perform.
I'm curious if there's a reason to use the php rename and unlink instead of file_unmanaged_copy and file_unmanaged_delete?
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commented#1377740: file_unmanaged_move() should issue rename() where possible instead of copy() & unlink()
This is a copy of what I use in AdvAgg in order to avoid multiple writes overwriting each other. If you don't do this then you can get corrupted files fairly easily in a high concurrent environment.
I could use file_unmanaged_delete but that would fill the watchdog table up most likely.
Comment #4
gregglesI see, OK. I'm inclined to commit this but want to wait just a little more for anyone else to review.
Comment #5
asrobIt works, successfully applied patch in 7.x-1.x, that's why I changed its status.
Comment #6
markdorisonRTBC. Should this be ported to 8.x as well?
Comment #7
gregglesYes, I think so. @markdorison, want to work on that port?
Comment #8
mikeytown2 CreditAttribution: mikeytown2 commentedHeads up that in advagg (which is where the write & rename code came from) I discovered that drupal_tempnam doesn't work as expected if the dir is a stream wrapper. The above patch already has a workaround:
It works, we just might want to make it more clear in the code what is going on and why this is needed.
Comment #9
markdorisonPorted patch to 8.x.
Comment #10
asrobI successfully applied this patch and seems to work well. But this issue (#2795175: Handle guzzle client exceptions gracefully) does almost the same thing so we need to figure it out what we should do these issues.
However, I mark this as RTBC'ed because I prefer this patch!
Comment #11
geek-merlinAs i understand it, #2795175: Handle guzzle client exceptions gracefully touches the same code, but its change is completely orthogonal to this.
We should have both.
As this patch touches more code, i'd follow the suggestion to commit this and manually rebase the other patch onto this.
Comment #13
markdorison