Skip to content

[ISSUE #10383] Align Bazel dependencies with Maven pom.xml#10404

Merged
lollipopjin merged 1 commit into
apache:developfrom
lizhimins:ISSUE-10383-align-bazel-deps
May 29, 2026
Merged

[ISSUE #10383] Align Bazel dependencies with Maven pom.xml#10404
lollipopjin merged 1 commit into
apache:developfrom
lizhimins:ISSUE-10383-align-bazel-deps

Conversation

@lizhimins
Copy link
Copy Markdown
Member

@lizhimins lizhimins commented May 28, 2026

Summary

  • Align Bazel WORKSPACE dependencies with Maven pom.xml (source of truth)
  • Fix the root cause of Bazel CI SIGSEGV crashes (wrong RocksDB artifact)
  • Fix ConfigStorage daemon thread use-after-free race condition
  • Fix 3 flaky tests that caused intermittent CI failures across platforms

Key Changes

Bazel dependency alignment

Category Change
Critical fix org.apache.rocketmq:rocketmq-rocksdb:1.0.6org.rocksdb:rocksdbjni:8.4.4
Artifact rename org.lz4:lz4-java:1.8.0at.yawk.lz4:lz4-java:1.10.3
Artifact rename org.bouncycastle:bcpkix-jdk15on:1.69bcpkix-jdk18on:1.83
Version bumps netty-all, guava, commons-lang3, commons-io, gson, okio, etc.
Missing deps Added slf4j-api:2.0.3, javassist:3.20.0-GA, grpc-protobuf:1.47.0
Cleanup Removed duplicate fastjson2 entry
Build fix Added --nojava_header_compilation (netty-all 4.1.130+ is POM-only)

Bug fix: ConfigStorage SIGSEGV

Removed setDaemon(true) from ConfigStorage.FlushSyncService and scheduledExecutorService. The daemon flag caused ServiceThread.shutdown() to skip thread.join(), so the flush thread could still be calling db.flushWal() when AbstractRocksDBStorage.shutdown() closed the RocksDB native handle — triggering SIGSEGV in rocksdb::log::Writer::WriteBuffer(). Core storage flush threads (like CommitLog GroupCommitService) are non-daemon by convention.

Flaky test fixes

Test Platform Root Cause Fix
RocksDBMessageStoreTest Ubuntu RocksGroupCommitService async flush not complete before CQ read Added Awaitility.await() to poll until offset is committed
IndexStoreServiceTest Windows System.currentTimeMillis() ~15ms resolution causes timestamp collision in createNewIndexFile Increment timestamp until unique key found
ReplicasManagerTest macOS Fixed sleep replaced with Awaitility polling; added setHaListenPort(0); fixed shutdown order

Motivation

The Bazel CI had been failing with JVM SIGSEGV crashes on RocksDB-related tests. Root cause: WORKSPACE declared rocketmq-rocksdb:1.0.6 (an obsolete shim with mismatched native library) while Maven uses org.rocksdb:rocksdbjni:8.4.4. The daemon thread issue in ConfigStorage amplified this — even with the correct library, the use-after-free race could still crash.

Test plan

  • bazel build //... passes (583 targets)
  • bazel test //... passes on CI (remote execution)
  • All three previously-flaky tests verified locally
  • Maven compilation unaffected (no pom.xml changes)

🤖 Generated with Claude Code

@lizhimins lizhimins force-pushed the ISSUE-10383-align-bazel-deps branch from 8b853ee to 0edc8f9 Compare May 28, 2026 11:51
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.93%. Comparing base (c9e51d6) to head (063881f).

Files with missing lines Patch % Lines
.../rocketmq/tieredstore/index/IndexStoreService.java 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10404      +/-   ##
=============================================
- Coverage      49.09%   47.93%   -1.17%     
+ Complexity     13507    13253     -254     
=============================================
  Files           1376     1376              
  Lines         100537   100536       -1     
  Branches       12983    12983              
=============================================
- Hits           49362    48191    -1171     
- Misses         45180    46406    +1226     
+ Partials        5995     5939      -56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lizhimins lizhimins force-pushed the ISSUE-10383-align-bazel-deps branch 6 times, most recently from 4706e31 to 1589896 Compare May 28, 2026 16:05
Replace outdated/incorrect Bazel WORKSPACE artifacts with versions matching
Maven source of truth. Key fixes:
- Replace rocketmq-rocksdb:1.0.6 with org.rocksdb:rocksdbjni:8.4.4
- Replace org.lz4:lz4-java:1.8.0 with at.yawk.lz4:lz4-java:1.10.3
- Replace bcpkix-jdk15on:1.69 with bcpkix-jdk18on:1.83
- Bump netty-all 4.1.65 -> 4.1.130, guava 31 -> 32, grpc 1.47 -> 1.53
- Bump commons-lang3, commons-io, commons-validator, gson, okio, etc.
- Add missing deps: slf4j-api, javassist, grpc-protobuf
- Remove duplicate fastjson2 entry
- Add --nojava_header_compilation for netty-all POM-only artifact compat
- Add Aliyun Maven mirror for faster dependency resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lizhimins lizhimins force-pushed the ISSUE-10383-align-bazel-deps branch from 1589896 to 063881f Compare May 28, 2026 16:20
Copy link
Copy Markdown
Contributor

@lollipopjin lollipopjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lollipopjin lollipopjin merged commit 9443c6d into apache:develop May 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants