Repository navigation
fix: never make a page wait on WebDecoy Cloud when ingest is slow or down - #104
Merged
Merged
Conversation
…down Detections were sent inline during init, before the block decision, with a 10 second timeout, and installs without a stored organization id made a second 10 second key lookup first. When ingest was slow or down, every flagged page view stalled for up to 20 seconds (WebDecoy/app#1245). - Detections are queued during the request and sent from a shutdown handler after fastcgi_finish_request(), with a 3 second timeout and the stored organization id, so one send is one request. - A refusal (429, 5xx, no answer) pauses cloud calls for 60 seconds across all requests, so an outage costs one attempt per minute, not one per page. - IP enrichment, which filter rules need in the page path, skips the call while paused and starts the pause on an unavailable answer. - Tests pin the deferral, the backoff and, by reading the plugin source, that the only detection send is inside the deferred sender.
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For WebDecoy/app#1245, item 2.
Problem: for any visitor scoring 40+, the plugin sent the detection inline during
init, before the block decision. That send had a 10s timeout, and installs without a stored org id did a 10svalidate-keylookup first. During an ingest outage, flagged page views stalled up to ~20s.Fix
fastcgi_finish_request(). Blocking and local logging never wait on the cloud.ip.*filter rules) skips the call while paused and starts the pause on an unavailable answer. That removes the 2s-per-new-IP cost during an outage.Tests:
php tests/run.phpgives 189 passed (7 new).->submitDetection(must sit insideWebDecoy_Detection_Sender::defer.Ships in the next plugin release.