-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Queue Job Batching #446
Comments
@masterix21 I believe this is a breaking change due to 3.0.2 changes in #438 If I revert back to 3.0.1 I cannot replicate the issue anymore |
I'm experiencing this issue on 3.0.1 as well unfortunately. Did you change anything else? |
Hey I may have a solution to the problem which works for me. I'm not 100% sure why it works, because it has to do with (this is just my inclination) the way laravel handles these batched types of jobs. So when I looked at my queue logs, I saw that the first was working and the second was not, which led me to believe that the 'next' jobs in the batch are failing because of some reason. So I went looking into what happended in the package whenever a job gets handled. Which is: In the "MakeQueueTenantAwareAction" class, you will see that before a job is being processed or retried this code is called:
After that the tenantId is checked for being on the job and if so, the tenant is made current again. In all my jobs, this tenantId is there so that is not the problem, but removing the code as above here, so just 'not forgetting the tenant' makes the problem go away (at least for me). Again I'm unsure why, but it works. So I created my own MakeQueueTenantAwareAction, extended theirs and wrote my own two functions for where that code get called. Result below:
Let me know if this works for you! Or if you have any idea why this solution tends to work haha. Cheers! |
@ChristiaanBilthof That’s why I revert to 3.0.1 because I have identify as well what you are saying. Forgetting the tenant was added on 3.0.2 to fix a different issue but it seems it’s not the proper way |
Same issue here:
Thanks for the suggestion to revert back to 3.0.1 @moisish |
Oops, even though it was already reverted to 3.0.1, the issue is still happening in my case. Moved // config/queue.php
...
'batching' => [
'database' => 'landlord',
'table' => 'job_batches',
], |
Thanks for the suggestion @ChristiaanBilthof. Were you able to find any side effects of this solution? Is all the rest working fine? I can't find a solution after a few hours of debugging. But removing that line fixes the issue, just wondering how solid is it in terms of side effects. |
I haven't encountered any side effects myself (makes me wonder if that code is even neccessary btw). |
@masterix21 Any thoughts on this? |
anyone found solution about this? the batch jobs are failing. somehow the connection in lost in between. |
@moisish, please create a repository that includes the code with errors and grant me access to it. This will help with testing and fixing the issues. Thank you in advance. |
When I try to dispatch job on localhost using this pacakge it gives me below error. after debug i found that, for batch job when it pick the connection, that time the database value is null. In above image you can see line number 152 for DatabaseQueue.php file for bulk method. and console log have database=null which should dynamically set as current tenant DB. below is the log
|
@sanketr43, please create a repository with the issue and add me, so I'll try. If you can't, create a PR here with a pest-test to catch the issue. Thanks |
Hello @masterix21 |
@masterix21 are you able to check? |
@sanketr43: the invitation has expired |
Try again with the release 3.0.3. Thanks! |
I am experiencing the same issue that has been discussed here #356
I am dispatching couple of jobs in a batch which on a successful run will run a final job
Some of the batched jobs are failing with the following error
So far I have identify that this exists only when the job_batches table is on the tenant's connection
The text was updated successfully, but these errors were encountered: