-
Notifications
You must be signed in to change notification settings - Fork 38
Comments
Fix data race in MariaModule groups_ vector access#210
Draft
Copilot wants to merge 3 commits intoeloq-10.6.10 from
Draft
Fix data race in MariaModule groups_ vector access #210Copilot wants to merge 3 commits intoeloq-10.6.10 from
Copilot wants to merge 3 commits intoeloq-10.6.10 from
Conversation
Important
Review skipped
Bot user detected.
To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Comment @coderabbitai help to get the list of available commands and usage tips.
- Added mutable std::mutex groups_mutex_ to MariaModule class - Updated ResizeGroups() and SetGroup() to protect vector modification with mutex - Updated ExtThdStart() to use mutex and check for nullptr before dereferencing - Updated ExtThdEnd() to use mutex and check for nullptr before dereferencing - Updated Process() to use mutex and check for nullptr before dereferencing - Updated HasTask() to use mutex and check for nullptr before dereferencing Co-authored-by: githubzilla <10080336+githubzilla@users.noreply.github.com>
Added defensive bounds checking in SetGroup() to prevent potential out-of-bounds access. Fixed code style to use space around assignment operator. Co-authored-by: githubzilla <10080336+githubzilla@users.noreply.github.com>
Copilot
AI
changed the title
(削除) [WIP] Fix concurrent issue in MariaModule's groups vector (削除ここまで)
(追記) Fix data race in MariaModule groups_ vector access (追記ここまで)
Jan 16, 2026
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.
Uh oh!
There was an error while loading. Please reload this page.
The
groups_vector inMariaModulewas accessed concurrently by external worker threads (inProcess(),HasTask()) and SQL threads (inExtThdStart(),ExtThdEnd()) without synchronization. Concurrent writes viaResizeGroups()andSetGroup()during pool size changes caused vector reallocation races and nullptr dereferences.Changes
mutable std::mutex groups_mutex_toMariaModuleclassResizeGroups()andSetGroup()now acquire mutex during vector modificationExtThdStart(),ExtThdEnd(),Process(), andHasTask()now:groups_vectorPattern
All reader methods now follow:
This ensures no data races during vector reallocation while minimizing lock contention by releasing the mutex before accessing
thread_group_tmembers.Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.