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: Prevent Laravel Queue hooks from stacking up #2899

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

PROFeNoM
Copy link
Contributor

@PROFeNoM PROFeNoM commented Oct 17, 2024

Description

A customer reported hitting the hook limit from laravel.queue.action hook installs.

While their issue disappears when removing these three lines (CallQueueHandler::call being called before the job handler), this is by no means a fix. For legacy, doing method_exists on the hooked $class::$method was returning true for them, and we have had confirmation that this method was indeed being called; yet, the hook wasn't invoked.

This PR acts as a mitigation by preventing hooks from stacking up by removing them during the post-hook of the surrounding fire operation. It doesn't fix the issue.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@PROFeNoM PROFeNoM self-assigned this Oct 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.91%. Comparing base (3f3547d) to head (73c12ff).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2899      +/-   ##
============================================
+ Coverage     78.21%   80.91%   +2.70%     
  Complexity     2526     2526              
============================================
  Files           173      146      -27     
  Lines         18749    14713    -4036     
  Branches        988        0     -988     
============================================
- Hits          14664    11905    -2759     
+ Misses         3544     2808     -736     
+ Partials        541        0     -541     
Flag Coverage Δ
appsec-extension ?
tracer-extension 78.10% <ø> (ø)
tracer-php 82.09% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...egrations/LaravelQueue/LaravelQueueIntegration.php 96.00% <100.00%> (+0.02%) ⬆️

... and 27 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f3547d...73c12ff. Read the comment docs.

@pr-commenter
Copy link

pr-commenter bot commented Oct 17, 2024

Benchmarks [ tracer ]

Benchmark execution time: 2024-10-17 09:11:58

Comparing candidate commit 73c12ff in PR branch alex/AIDM-358_laravel-queue-mitigation with baseline commit 3f3547d in branch master.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 176 metrics, 0 unstable metrics.

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟥 execution_time [+7.847µs; +12.569µs] or [+4.354%; +6.973%]

scenario:TraceFlushBench/benchFlushTrace

  • 🟥 execution_time [+1000.000ns; +1000.000ns] or [+100.000%; +100.000%]

@PROFeNoM PROFeNoM marked this pull request as ready for review October 17, 2024 13:20
@PROFeNoM PROFeNoM requested a review from a team as a code owner October 17, 2024 13:20
@PROFeNoM PROFeNoM merged commit 8f7175e into master Oct 18, 2024
624 of 649 checks passed
@PROFeNoM PROFeNoM deleted the alex/AIDM-358_laravel-queue-mitigation branch October 18, 2024 09:05
@github-actions github-actions bot added this to the 1.5.0 milestone Oct 18, 2024
@bwoebi bwoebi modified the milestones: 1.5.0, 1.4.2 Oct 18, 2024
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.

4 participants