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

3.8.5 Possible regression in injecting tenant models into queued jobs #1260

Open
stancl opened this issue Oct 3, 2024 · 4 comments
Open
Assignees
Labels
help wanted Extra attention is needed

Comments

@stancl
Copy link
Member

stancl commented Oct 3, 2024

Bug description

The changes made in #1251 have made injecting tenant models into queued jobs not work again, as in older versions of v3.

Steps to reproduce

Inject a tenant-context model into a queued job.

Expected behavior

Should be supported.

Laravel version

any

stancl/tenancy version

3.8.5

@stancl stancl added the bug Something isn't working label Oct 3, 2024
@stancl stancl self-assigned this Oct 3, 2024
@stancl stancl added the help wanted Extra attention is needed label Oct 3, 2024
@stancl
Copy link
Member Author

stancl commented Oct 3, 2024

This has been reported but I can't seem to reproduce the bug myself in a fresh Laravel 11 app. Will appreciate any testing.

@stancl stancl changed the title 3.8.5 regression in injecting tenant models into queued jobs 3.8.5 Possible regression in injecting tenant models into queued jobs Oct 4, 2024
@stancl stancl removed the bug Something isn't working label Oct 4, 2024
@nicolay12866
Copy link

Hi, I do have this problem when queueing batches for one tenant (300-400 jobs) with a lot of data using laravel 10.48.22 and php 8.2.19 and on our test server with php 8.2.23. After 10 or so jobs it starts failing for the rest of them. For me reverting to tenancy 3.8.4 gets our environment running again.

@stancl
Copy link
Member Author

stancl commented Oct 22, 2024

Job batches aren't supported in v3 (maybe the support is flaky rather than completely missing?). We've added a bootstrapper in v4 to address that. So it's possible that the < 3.8.5 behavior made them work in your case for some reason?

Can you reproduce this using pure jobs without batches?

@nicolay12866
Copy link

I can confirm that it works when I just dispatch them immediately instead of batching them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants