-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Webhook processing time limit #9573
Merged
RCheesley
merged 13 commits into
mautic:features
from
escopecz:webhook-processing-time-limit
Feb 13, 2021
Merged
Webhook processing time limit #9573
RCheesley
merged 13 commits into
mautic:features
from
escopecz:webhook-processing-time-limit
Feb 13, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## features #9573 +/- ##
==============================================
+ Coverage 38.33% 38.50% +0.16%
- Complexity 33939 33940 +1
==============================================
Files 1982 1982
Lines 104948 104952 +4
==============================================
+ Hits 40236 40409 +173
+ Misses 64712 64543 -169
|
Also the output is empty when all tests run. Not important, removing it.
kuzmany
approved these changes
Jan 29, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works perfectly 👍
Approve it
I have added an issue to add this to the Dev Docs in the webhooks section: mautic/developer-documentation#187 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Issues or PR's relating to bugs
cla-signed
The PR contributors have signed the contributors agreement
enhancement
Any improvement to an existing feature or functionality
needs-documentation
PR's that need documentation before they can be merged
ready-to-commit
PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged
T1
Low difficulty to fix (issue) or test (PR)
webhooks
Anything related to webhooks
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please be sure you are submitting this against the staging branch.
Description:
There are issues with webhook processing when there are too many events to send. The processing method is called recursively until the queue is empty. This was causing timeout issues in our system as the webhook processing never stopped due to new records in the webhook queue. This PR is adding 10 minutes time limit (configurable) to stop processing after the limit is hit.
This PR also improves the query getting rows from the webhook queue table and adds a new index that speeds up the query even more.
Steps to reproduce the bug:
'webhook_limit' => 1,
in local.php which means send 1 event in 1 request (so it will take longer, that's what we need for our test).app/console m:w:p -i ID
. Replace the ID with the ID of your webhook.Steps to test this PR:
'webhook_time_limit' => 1,
in local.php which means timeout the processing after 1 second.