Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Clone Job specific properties #19123

Merged
merged 1 commit into from
May 9, 2017
Merged

[5.5] Clone Job specific properties #19123

merged 1 commit into from
May 9, 2017

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented May 9, 2017

Taking a Mailable for example, while queuing it a SendQueuedMailable is dispatched which holds the mailable as a $mailable property.

While the job is being serialized, if the mailable uses the SerializesModels trait all properties referencing an Eloquent Model will have its value replaced with a ModelIdentifier, taking into account that we serialize a cone of the job in Queue::createObjectPayload() one might think that the mailer object will still hold references to Model objects in the original job instance, but this is not the case since the original job and the clone both points to the same reference of the mailable, and thus the __sleep method that ran while serializing will affect the mailable in the original as well.

@taylorotwell taylorotwell merged commit 0a46498 into laravel:master May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants