UID2-7489: route /optout/status through the blocking handler when async batch requests are enabled#2651
Open
sunnywu wants to merge 1 commit into
Open
UID2-7489: route /optout/status through the blocking handler when async batch requests are enabled#2651sunnywu wants to merge 1 commit into
sunnywu wants to merge 1 commit into
Conversation
…nc batch requests are enabled /v2/optout/status is a batch endpoint (accepts up to optout_status_max_request_size, default 5000, advertising IDs per request) but was registered with a plain event-loop handler regardless of the enable_async_batch_request flag, unlike the other batch/ mapping endpoints (identity/map, identity/buckets, key/sharing, key/bidstream). Move its registration into the isAsyncBatchRequestsEnabled if/else, guarded by optOutStatusApiEnabled, so it uses blockingHandler(..., false) (worker pool, unordered) when the flag is on and a plain handler when off, mirroring identity/map. Behaviour is unchanged when enable_async_batch_request is false (the default), so this is a no-op in current prod config; the worker-pool path only activates under the same flag that already governs the other batch endpoints. Added a test asserting the endpoint still succeeds with async batch requests enabled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Ticket: UID2-7489 Branch: syw-UID2-7489-optout-status-blocking-handler
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.
Summary
/v2/optout/statusis a batch endpoint — it accepts up tooptout_status_max_request_size(default 5000) advertising IDs per request and looks each up in the opt-out store. However, it was registered with a plain event-loophandler(...)regardless of theenable_async_batch_requestflag, unlike the other batch/mapping endpoints:enable_async_batch_request=true=falsekey/sharing,key/bidstream,identity/buckets,identity/map(v2/v3)blockingHandler(..., false)(worker pool)handler(...)(event loop)optout/status(before)handler(...)(event loop) — inconsistenthandler(...)(event loop)optout/status(after)blockingHandler(..., false)(worker pool)handler(...)(event loop)This PR moves the
optout/statusregistration into the existingisAsyncBatchRequestsEnabledif/else (still guarded byoptOutStatusApiEnabled), so it is offloaded to the Vert.x worker pool when async batch requests are enabled — mirroringidentity/map.Why
optout/statushas the same "potentially heavy per-request work" profile asidentity/map(up to 5000 lookups/request). When async batch offloading is enabled to keep the event loop responsive, this endpoint should be included; leaving it on the event loop undermines the purpose of the flag.Risk / rollout
Low. With
enable_async_batch_request=false(the current default) the behaviour is byte-for-byte identical to before — this is a no-op in current prod config. The worker-pool path only activates under the same flag that already governs the other batch endpoints, and the request/response contract is unchanged; only the executing thread differs.ordered=falsematches the sibling endpoints (no cross-request ordering requirement).Testing
optOutStatusRequestWithAsyncBatchEnabled— asserts/v2/optout/statusstill returns a correct success response withenable_async_batch_request=true(i.e. via the blocking handler path).Jira: UID2-7489
🤖 Generated with Claude Code