[8.0] MOD-8391: Report active threads-indexes upon crash#5842
Merged
Conversation
* Add new activeThreads API * Fix docs, add container populatoin * Add logging in crash * Add Linux thread id to log, add GC thread to active threads container * Add main-thread registrations * Fix * fix initialization * Address review * Fix leak * Fix assertion * Touchup * * pivot - keep track of the active queries and cursors in the main thread when blocking the client - keep track at each thread the spec it is working on. * * fix spellcheck error * fix compilation * * fix spellcheck typo * * fix tests * * wrong function name - should be CaseInsensitiveCompare * * revert * * fix typos * * fix some tests * * bring back old code that was removed by mistake * * add a dtor function to the thread local variable to avoid reallocating on every set * * do not omit argument name - fixes compilation error on some operating systems * * add missing includes * * change include order * * cleanup memory in CurrentThread_ClearIndexSpec to avoid thread lifetime leak. * * try and upload the so library as an artifact on failure * * fix typo * * also upload the debug symbols as an artifact * * add debug symbols to diagnose crash * * suspect the reference mechanism is not atomic enough * unified strong and weak ref count into a single variable to ensure atomicity * * change Strong value and make it 64 bit * * revert some changes that were made to locate the gc crash * don't set the index spec in the gc thread * * missed a set call - commented it out * * fix gc flow - use weak ref to take into account race condition of index deletion after first strong ref is taken. * try and use free callback for thread local variable * * update comment * add a log in case thread forgot to cleanup * * remove unneeded fields * code cleanup * duplicate index name to output something if promote fails during crash * * fix tests * * fix return for ThreadLocalStorage_Init * * add CurrentThread_TryGetSpecInfo * use CurrentThread_TryGetSpecInfo in info_redis.c * some code cleanup * * fix compilation error * * clear spec in DistAggregateCleanups * * code review comments * * fix typo * * code review comments * restructured the files, moved them to be under info folder * cursor object is retrieved in main thread * if it is a shard cursor we will add it to the blocked queries cursor list * * try and take a strong ref when dealing in cursor query * * add result processor when using debug search commands to allow crashing the query * add a test to check the additional crash information is correct * * small code review fixes * * change error so test will pass * use correct submodule * * code review comments - Andres * - make set and clear part of the ref promote and release. - found a few more places where we could set the index spec * - fix leak * - raz code review comments --------- Co-authored-by: jonathan keinan <[email protected]> (cherry picked from commit 384a2f6)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.0 #5842 +/- ##
==========================================
- Coverage 88.11% 87.25% -0.87%
==========================================
Files 202 206 +4
Lines 36287 36519 +232
==========================================
- Hits 31976 31864 -112
- Misses 4311 4655 +344 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
raz-mon
approved these changes
Mar 30, 2025
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.
Manual backport of #5403.