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

ProcessPendingUpdates #1291

Closed
hipoagencia opened this issue Jun 28, 2023 · 7 comments
Closed

ProcessPendingUpdates #1291

hipoagencia opened this issue Jun 28, 2023 · 7 comments
Assignees

Comments

@hipoagencia
Copy link

Horizon Version

5.15

Laravel Version

10.13

PHP Version

8.1

Redis Driver

Predis

Redis Version

Last

Database Driver & Version

Centos

Description

Hello!

When I'm running on the online server, after finishing the entire queue, these processes keep appearing. Can you tell what it could be? Look the screenshot

Ver se descobre

Thanks

Steps To Reproduce

Just send jobs to Horizon

@lucaspanik
Copy link

@hipoagencia

Could it have something to do with it?
laravel/telescope#1349

@hipoagencia
Copy link
Author

@lucaspanik

Hey, thanks for your suggestion. Looks like you got the anwser. I will make time to follow all the messages in this topic.
Thanks for your help

@pyrou
Copy link

pyrou commented Jul 3, 2023

This looks definitely related. Telescope 4.15 introduce this new Laravel\Telescope\Jobs\ProcessPendingUpdates Job.

As I understood how it supposed to work, when the JobWatcher call a Telescope::recordUpdate() (when job being processed OR when job failed) an update is pushed to the Telescope::$updatesQueue.
This cause a ProcessPendingUpdates dispatch (see Telescope::store() implementation)

Problem is, we mostly all have $entry->isFailedJob() condition in our TelescopeServiceProvider, to only store failed job in telescope. So a "normal" job does NOT exists in telescope_entries table.

Because of this, the telescope_entries can't be updated, and is pushed again here. As $failedUpdates not empty, ProcessPendingUpdates job is retried 10sec later.

So each normal Job, generate 3 extra ProcessPendingUpdates job.

@nunomaduro may help on this ?

@nunomaduro
Copy link
Member

The goal of this particular job is process any pending updates on Telescope. So, we probably should ignore it on Horizon somehow. Can you make a pull request (and test it locally) on that @hipoagencia ?

@hipoagencia
Copy link
Author

This looks definitely related. Telescope 4.15 introduce this new Laravel\Telescope\Jobs\ProcessPendingUpdates Job.

As I understood how it supposed to work, when the JobWatcher call a Telescope::recordUpdate() (when job being processed OR when job failed) an update is pushed to the Telescope::$updatesQueue. This cause a ProcessPendingUpdates dispatch (see Telescope::store() implementation)

Problem is, we mostly all have $entry->isFailedJob() condition in our TelescopeServiceProvider, to only store failed job in telescope. So a "normal" job does NOT exists in telescope_entries table.

Because of this, the telescope_entries can't be updated, and is pushed again here. As $failedUpdates not empty, ProcessPendingUpdates job is retried 10sec later.

So each normal Job, generate 3 extra ProcessPendingUpdates job.

@nunomaduro may help on this ?

Perfect explanation, thanks for your time.

@hipoagencia
Copy link
Author

The goal of this particular job is process any pending updates on Telescope. So, we probably should ignore it on Horizon somehow. Can you make a pull request (and test it locally) on that @hipoagencia ?

Okay! I'm late to travel and i dont have time to do this right now. But, as soon as i can, i will do.
Thanks for your help. (@nunomaduro by the way, Thanks for the awesome job with Laravel and everything that comes with)

@trin4ik
Copy link

trin4ik commented Feb 25, 2024

I use telescope and horizon in my app too, and also faced the same problem. i need telescope mainly for excepеions etc, so i decided to act roughly.
https://github.com/laravel/telescope/blob/4.x/src/Telescope.php#L672C36-L672C50
This is the only place where ProcessPendingUpdates is called, as we can see, it is enough to throw a variable $_ENV['VAPOR_SSM_PATH']. my app is running in k8s, I just added VAPOR_SSM_PATH: false to ConfigMap and jobs are not created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants