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

Fix sending queued reports on Laravel Vapor queues #398

Merged
merged 5 commits into from
Jul 20, 2021

Conversation

AlexVanderbist
Copy link
Contributor

Laravel Vapor processes queued jobs one by one without firing the Looping event in between jobs. Vapor also doesn't call PHP's registered shutdown functions (on the queue lambda at least). Exceptions thrown in Vapor jobs will not get reported because of these two issues.

The solution is to use both the queue before and after events. Before will send any pending reports (from a before the queued job) and make sure the dump/log/query recorders are emptied before executing the queued job. After will report any exceptions thrown during job execution.

Because we're using both before and after, there's some overlap but as this only causes some internal arrays to be emptied twice, this can be ignored.

@AlexVanderbist AlexVanderbist merged commit 2b94425 into main Jul 20, 2021
@rodrigopedra
Copy link
Contributor

@AlexVanderbist this seems to have caused #401

Had to revert to 2.11.0 due to errors on horizon

@AlexVanderbist AlexVanderbist deleted the laravel-vapor-queue-fixes branch July 20, 2021 13:56
@freekmurze
Copy link
Collaborator

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.

3 participants