Conversation
…the server's query policy to dictate time limits for expensive filters.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This revision replaces the earlier Code Review DetailsNo blocking findings. Both prior review threads appear addressed by this revision: the unbounded-search question by the explicit 300-second limit, and the request for verification/test coverage by |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1210 +/- ##
============================
============================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // legitimate filters (e.g. LDAP_MATCHING_RULE_IN_CHAIN over nested groups) can exceed | ||
| // that and come back empty or as a timeLimitExceeded error. 0 defers to the server's | ||
| // own query policy instead. | ||
| timeLimit: 0, |
There was a problem hiding this comment.
❓ QUESTION: With timeLimit: 0 there is no upper bound on how long a search can block — was that acceptable, or would a generous explicit limit be safer?
Details
ldapts.ClientOptions.timeout is not set in bind(), so there is no client-side operation timeout either. The search now relies entirely on the server's query policy:
- Active Directory:
MaxQueryDurationdefaults to 120s, so bounded. - OpenLDAP:
olcTimeLimitdefaults to 3600s, and therootdnis exempt from limits entirely — a sync bound asrootdncould hang with no feedback to the user or CLI cron job.
If unbounded waits are not desired, either an explicit generous timeLimit (e.g. 300–600 seconds) or a client-level timeout in the ldapts.ClientOptions built in bind() would keep the fix for the AD case while still failing loudly on a truly stuck query.
| // legitimate filters (e.g. LDAP_MATCHING_RULE_IN_CHAIN over nested groups) can exceed | ||
| // that and come back empty or as a timeLimitExceeded error. 0 defers to the server's | ||
| // own query policy instead. | ||
| timeLimit: 0, |
There was a problem hiding this comment.
This seems ok on the surface, but I have no idea if it actually fixes the issue... We need to be able to guarantee this fixes the issue and provide test coverage for it.
… into ac/pm-33583-AD-user-filter-sees-user-in-direct-group,-spends-20-seconds-searching-then-fails
…h time limit configuration Introduced a new test suite for LdapDirectoryService that verifies the application of a custom server-side time limit for LDAP searches. The time limit is set to 5 minutes, replacing the default 10 seconds, to accommodate complex queries. Tests ensure that the time limit is consistently applied across various search scenarios, including user and group lookups, as well as Active Directory-specific searches.
Jared signed off in Brandon's absence
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-33583
📔 Objective
Fixes issue in DC where timeout makes it seem like sync succeeds and brings back no results... Passing
timeLimitto server allows the server to use it's own query policy for timeout instead.Before
directory-connector-timeout-issue.webm
After
dc-no-longer-times-out-on-client-side.webm