Conversions aren't always generated when queued and running parallel #3674
-
We're having weird issues for a while where some conversions aren't generated. Hard te reproduce because it doesn't happen every time. On a model we do have 3 conversions; mini, thumb and detail. Mini isn't queued and is always generated. The other 2 are queued. In code:
This in combination with Laravel Horizon and
Does sometimes result in just Running I added some debugging and it seems like it's caused by a directory which is deleted which shouldn't happen. Related: #3630 but in another file; here the temp directory is created and the whole directory will be removed at the end:The temp directory should be unique: but when I add some logging here: withlogger($conversionTempFile); I'm getting:
Where So To reproduce it simply use the same directory here: with for example:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
I'm not the only one: https://laracasts.com/discuss/channels/laravel/repeated-values-from-strrandom |
Beta Was this translation helpful? Give feedback.
-
We're switching to a queue with 1 worker for now:
|
Beta Was this translation helpful? Give feedback.
-
Ah, I've just raised #3677 which seems to be a duplicate of this. We get the exact same where the run time is 0 seconds exactly and no conversions generated, yet still marked as completed. @royduin Hows just running a single process going for you? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your research on this. It's interesting that Str::random() is generating duplicate values on Horizon and as you've pointed out this seems to be an issue that has been raised elsewhere. I'm just updating a project to run a fork where I've added a prefix value to the temporary path generator. This is the only way I can think that'd ensure uniqueness in this situation - without having to delve deeper into the true issue at this point in time. I'll let you know how it goes and if it works I'll PR it over. |
Beta Was this translation helpful? Give feedback.
-
I don't think this setup works, because you'll update the models possibly in parallel. So they can be hit/updated at random. You'll indeed need to set |
Beta Was this translation helpful? Give feedback.
Raised a PR to address this #3687