fix(api): Fix $text search timeout and rename DB_MAX_TIME_MESSAGES_SEARCH#1005
Closed
martian-str33t wants to merge 1 commit intozone-eu:masterfrom
Closed
fix(api): Fix $text search timeout and rename DB_MAX_TIME_MESSAGES_SEARCH#1005martian-str33t wants to merge 1 commit intozone-eu:masterfrom
martian-str33t wants to merge 1 commit intozone-eu:masterfrom
Conversation
* #86c89t0yc: Fix $text search timeout on large mailboxes - Use 2-minute timeout for $text searches instead of 3 seconds (DB_MAX_TIME_MESSAGES vs DB_MAX_TIME_MESSAGES_SEARCH) - Fix retry to set opts.fields.maxTimeMS instead of opts.maxTimeMS (mongo-cursor-pagination reads from opts.fields) - Fix retry catch block referencing outer err instead of error * #86c89t0yc: Rename DB_MAX_TIME_MESSAGES_SEARCH to DB_MAX_TIME_FIELD_SEARCH
6 tasks
Contributor
|
In this commit I have added the shorter timeout, because there were issues with search on user accounts with lots of mailboxes (over 200), in which case it made sense to not pin the search on a mailbox, if the search took too much time. The logic was as follows: If the search took more time than 3 seconds, then we get the timeout error, and retry search without pinning the mailbox and with a longer timeout (2 mins). |
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
DB_MAX_TIME_MESSAGES, 2min) for$textfulltext searches and shorter timeout (DB_MAX_TIME_FIELD_SEARCH, 3s) for indexedsearch.*field querieserr→error) in the MaxTimeMSExpired catch blockmaxTimeMSon wrong object (opts→opts.fields)DB_MAX_TIME_MESSAGES_SEARCH→DB_MAX_TIME_FIELD_SEARCHfor clarityWithout this fix,
$textsearches on large mailboxes crash withMaxTimeMSExpiredafter 3 seconds because they were using the short field-search timeout instead of the generous fulltext timeout.