fix: reduce ListUsers MaxResults from 200 to 50 to prevent Lambda OOM/timeout#104
Open
c1-dev-bot[bot] wants to merge 1 commit into
Open
fix: reduce ListUsers MaxResults from 200 to 50 to prevent Lambda OOM/timeout#104c1-dev-bot[bot] wants to merge 1 commit into
c1-dev-bot[bot] wants to merge 1 commit into
Conversation
…/timeout
ListUsers with Projection("full") returns extensive per-user data including
organizations, custom schemas, relations, and POSIX accounts. For directories
with many custom-schema attributes, a page of 200 users can produce payloads
large enough to exceed Lambda memory limits or trigger context deadline
timeouts, resulting in FunctionError=Unhandled crashes.
Reducing MaxResults to 50 bounds the per-page payload size to prevent these
crashes while maintaining correct pagination behavior. The tradeoff is more
API calls per sync, but each call completes safely within Lambda constraints.
Fixes: CXH-1509
Contributor
Connector PR Review: fix: reduce ListUsers MaxResults from 200 to 50 to prevent Lambda OOM/timeoutBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryThis PR reduces the Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
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
MaxResultsforListUsersfrom 200 to 50 to prevent Lambda OOM/timeout crashes on tenants with large Google Workspace directoriesListUsersusesProjection("full")which returns extensive per-user data (organizations, custom schemas, relations, POSIX accounts, etc.) — with 200 users per page, directories with many custom-schema attributes can produce payloads large enough to exceed Lambda memory limits or trigger context deadline timeoutsFunctionError=Unhandledwithstatus code: 200because OOM/panic falls through the baton-sdk Lambda client's timeout detection logic atpkg/lambda/grpc/client.go:62-68to the generic error format at line 75Context
This matches the pattern seen in CE-582 where an identical
lambda_transport: Unhandled; status code: 200error was caused by Lambda timeout on large directory listing. The affected tenant has never completed a successful full sync.Test plan
Fixes: CXH-1509
Automated PR Notice
This PR was automatically created by c1-dev-bot as a potential implementation.
This code requires: