fix: replace weight calculation with a rounded ceil#52
Open
samc wants to merge 1 commit intowingify:masterfrom
Open
fix: replace weight calculation with a rounded ceil#52samc wants to merge 1 commit intowingify:masterfrom
samc wants to merge 1 commit intowingify:masterfrom
Conversation
rohitesh-wingify
added a commit
that referenced
this pull request
Nov 3, 2023
33a5f91 to
1d54f4e
Compare
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.
Looks like we stumbled across a bug in our production middleware that was resulting in some unwarranted internal service errors - looks to us like there's an overflow in the min / max value calculation for random mutually exclusive groups.
I'll use an example from our production code that was giving us trouble to explain the problem.
shortlistedCampaignswould then have their weights adjusted to 16 based on the following:vwo-node-sdk/lib/utils/DecisionUtil.js
Line 1016 in 16df6eb
3) based on that weight, the following would adjust the lower and upper bounds of
startVariationAllocation&endVariationAllocationrespectively:vwo-node-sdk/lib/utils/CampaignUtil.js
Line 41 in 16df6eb
4) this all results in a maximum upper bound of
9600when it comes time to decide on a variation:vwo-node-sdk/lib/core/BucketingService.js
Lines 62 to 64 in 16df6eb
_generateBucketValue, looks to default to a max of10000based onConstants.MAX_TRAFFIC_PERCENT. This leaves a 4% chance that an assigned bucketed value falls outside the acceptable bounds of all active tests in a group and returns null - failing on this line:vwo-node-sdk/lib/utils/DecisionUtil.js
Line 1033 in efee33f
Here's a snapshot of the overflow in action on our production site: