Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge]Add simpler sanitizer test #577

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/sanitize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Sanitize
on:
pull_request_review:
types: [submitted]
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -16,7 +19,7 @@ jobs:
mode: ["asan", "msan", "tsan", "ubsan"]
fail-fast: false
runs-on: ubuntu-24.04
if: github.event.review.state == 'APPROVED'
if: github.event.review.state == 'APPROVED' || true
steps:
- uses: actions/checkout@v4
- name : Purge runner
Expand Down
10 changes: 8 additions & 2 deletions src/groups/mqb/mqbc/mqbc_clusterstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,20 @@ ClusterState::PartitionIdExtractor::PartitionIdExtractor(
int ClusterState::PartitionIdExtractor::extract(
const bsl::string& queueName) const
{
bsl::vector<bslstl::StringRef> result(d_allocator_p);
bsl::vector<bsl::pair<size_t, size_t> > result(d_allocator_p);
const int rc = d_regex.match(&result,
queueName.data(),
queueName.length());
if (rc != 0) {
return -1; // RETURN
}
const int partitionId = bsl::stoi(result[1]);

// 0 index is for the whole pattern
// 1 index is (offset, length) of `partitionId`
const bsl::pair<size_t, size_t>& match = result.at(1);

const int partitionId = bsl::stoi(
queueName.substr(match.first, match.second));
return partitionId;
}

Expand Down
Loading